更新
This commit is contained in:
20
Python-100-Days/Day41-55/oa/hrs/admin.py
Normal file
20
Python-100-Days/Day41-55/oa/hrs/admin.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from hrs.models import Dept, Emp
|
||||
|
||||
|
||||
class DeptAdmin(admin.ModelAdmin):
|
||||
|
||||
list_display = ('no', 'name', 'location')
|
||||
ordering = ('no', )
|
||||
|
||||
|
||||
class EmpAdmin(admin.ModelAdmin):
|
||||
|
||||
list_display = ('no', 'name', 'job', 'sal', 'dept')
|
||||
search_fields = ('name', 'job')
|
||||
ordering = ('dept', )
|
||||
|
||||
|
||||
admin.site.register(Dept, DeptAdmin)
|
||||
admin.site.register(Emp, EmpAdmin)
|
||||
Reference in New Issue
Block a user