Commit c749ea36 authored by Isaiah Flores's avatar Isaiah Flores

Update widget_group3/widget_group3/admin.py

parent 77b7d1ee
......@@ -4,8 +4,8 @@ from .models import WidgetUser, Post, Reply, Announcement, Assignment, Departmen
# Classes
class DepartmentInline(admin.TabularInline):
model = Department
class WidgetUserInline(admin.TabularInline):
model = WidgetUser
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
......@@ -23,11 +23,24 @@ class WidgetUserAdmin(admin.ModelAdmin):
}),
]
inlines = [DepartmentInline,]
class DepartmentAdmin(admin.ModelAdmin):
model = Department
search_fields = ('dept_name', 'home_unit')
list_display = ('dept_name', 'home_unit')
list_filter = ('dept_name', 'home_unit')
fieldsets = [
('Department Data', {
'fields': [
'dept_name',
'home_unit',
]
}),
]
inlines = [WidgetUserInline,]
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
......@@ -115,3 +128,4 @@ admin.site.register(Post, PostAdmin)
admin.site.register(Reply, ReplyAdmin)
admin.site.register(Announcement, AnnouncementAdmin)
admin.site.register(Assignment, AssignmentAdmin)
admin.site.register(Department, DepartmentAdmin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment