Setup admin panel

parent 69dfa9a0
from django.contrib import admin from django.contrib import admin
# Register your models here. from .models import Department, WidgetUser
class DepartmentAdmin(admin.ModelAdmin):
model = Department
search_fields = ('department_name', 'home_unit')
list_display = ('department_name', 'home_unit')
list_filter = ['department_name', 'home_unit']
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
search_fields = ('last_name', 'first_name', 'middle_name', 'department')
list_display = ('last_name', 'first_name', 'middle_name', 'department')
list_filter = ['last_name', 'first_name', 'middle_name', 'department']
admin.site.register(Department, DepartmentAdmin)
admin.site.register(WidgetUser, WidgetUserAdmin)
\ No newline at end of file
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