Commit d68c8695 authored by Ian Rafael T. Aragoza's avatar Ian Rafael T. Aragoza

Update dashboard admin.py and populate its models

parent bbdd760c
Pipeline #2932 failed with stages
from django.contrib import admin from django.contrib import admin
from .models import Department, WidgetUser
# Register your models here. class DepartmentAdmin(admin.ModelAdmin):
model = Department
list_display = ('dept_name', 'home_unit',)
search_fields = ('dept_name',)
list_filter = ('home_unit',)
class UserAdmin(admin.ModelAdmin):
model = WidgetUser
list_display = ('last_name', 'first_name', 'middle_name', 'department',)
search_fields = ('last_name', 'first_name', 'middle_name',)
list_filter = ('department',)
fieldsets = [
('Name', {
'fields': [
# the tuple puts these fields in a single line
('last_name', 'first_name', 'middle_name'), 'department'
]
}),
]
admin.site.register(Department, DepartmentAdmin)
admin.site.register(WidgetUser, UserAdmin)
\ 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