From: williambratches Date: Tue, 25 Mar 2014 19:27:12 +0000 (-0400) Subject: added DepartmentModerator and ProfessorModerator classes to admin.py X-Git-Tag: release-20150131~144^2~12^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e02007c2822f2cae371cef6b2bded3434dbc275c;p=oweals%2Fkarmaworld.git added DepartmentModerator and ProfessorModerator classes to admin.py --- diff --git a/karmaworld/apps/moderation/admin.py b/karmaworld/apps/moderation/admin.py index 2f223af..321a2bc 100644 --- a/karmaworld/apps/moderation/admin.py +++ b/karmaworld/apps/moderation/admin.py @@ -33,7 +33,7 @@ show_notes.short_description = "Show selected notes" class CourseModerator(CourseAdmin): date_heirarchy = 'updated_at' # Identify fields to display on the Change page - list_display = ('name', 'flags', 'school', 'created_at', 'updated_at', 'instructor_name') + list_display = ('name', 'flags', 'url', 'updated_at', 'department','professor') # Sort by highest number of flags first, and then by date for ties. ordering = ('-flags', '-updated_at') # Enable resetting flags @@ -50,6 +50,27 @@ class NoteModerator(NoteAdmin): # Enable resetting flags actions = (reset_flags, hide_notes, show_notes) +# Structure views of Department objects +class DepartmentModerator(NoteAdmin): + date_heirarchy = 'uploaded_at' + # Identify fields to display on the Change page + list_display = ('name', 'school', 'url') + # Sort by highest number of flags first, and then by date for ties + ordering = ('-flags', '-uploaded_at') + # Enable resetting flags + actions = (reset_flags,) + +# Structure views of Professor objects +class DepartmentModerator(NoteAdmin): + date_heirarchy = 'uploaded_at' + # Identify fields to display on the Change page + list_display = ('name', 'email') + # Sort by highest number of flags first, and then by date for ties + ordering = ('-flags', '-uploaded_at') + # Enable resetting flags + actions = (reset_flags,) moderator.site.register(Course, CourseModerator) moderator.site.register(Note, NoteModerator) +moderator.site.register(Department, DepartmentModerator) +moderator.site.register(Professor, ProfessorModerator)