Commits

josephoenix committed 2a24422

Added inline admin for meetings to edit them from course admin views

  • Participants
  • Parent commits 2ca08b9

Comments (0)

Files changed (1)

File ourpomona/coursesearch/admin.py

 from django.contrib import admin
 from ourpomona.coursesearch.models import Course, Department, Meeting
 
-class CourseAdmin(admin.ModelAdmin):
-    list_display = ('code', 'name', 'instructor',)
-
 class DepartmentAdmin(admin.ModelAdmin):
     list_display = ('code', 'name', 'course_count')
 
 class MeetingAdmin(admin.ModelAdmin):
     list_display = ('course', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'begin', 'end', 'location',)
 
+class MeetingInline(admin.TabularInline):
+    model = Meeting
+    #list_display = ('course', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'begin', 'end', 'location',)
+
+class CourseAdmin(admin.ModelAdmin):
+    list_display = ('code', 'name', 'instructor',)
+    inlines = [MeetingInline,]
+
 admin.site.register(Course, CourseAdmin)
 admin.site.register(Department, DepartmentAdmin)
 admin.site.register(Meeting, MeetingAdmin)