From 9cb708dc1644f1b1c28659b8f756dac36369bedd Mon Sep 17 00:00:00 2001 From: Bryan Date: Wed, 26 Feb 2014 03:10:25 -0500 Subject: [PATCH] Adding Department to Admin interface --- karmaworld/apps/courses/admin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/karmaworld/apps/courses/admin.py b/karmaworld/apps/courses/admin.py index e26ac25..7e56d10 100644 --- a/karmaworld/apps/courses/admin.py +++ b/karmaworld/apps/courses/admin.py @@ -10,10 +10,18 @@ from django.contrib import admin from karmaworld.apps.courses.models import School from karmaworld.apps.courses.models import Course from karmaworld.apps.courses.models import Professor +from karmaworld.apps.courses.models import Department from karmaworld.apps.courses.models import ProfessorAffiliation class CourseAdmin(reversion.VersionAdmin, admin.ModelAdmin): """ an Admin handler for the Course model that handles fk search """ + raw_id_fields = ('department',) + autocomplete_lookup_fields = { + 'fk': ['department'] + } + +class DepartmentAdmin(reversion.VersionAdmin, admin.ModelAdmin): + """ an Admin handler for the Department model that handles fk search """ raw_id_fields = ('school',) autocomplete_lookup_fields = { 'fk': ['school'] @@ -22,4 +30,5 @@ class CourseAdmin(reversion.VersionAdmin, admin.ModelAdmin): admin.site.register(School) admin.site.register(Professor) admin.site.register(Course, CourseAdmin) +admin.site.register(Department, DepartmentAdmin) admin.site.register(ProfessorAffiliation) -- 2.25.1