Files
ITShowPlatform/Apps/enroll/admin.py
T
ladeng07 12f390949b Merge branch 'shine' of https://gitee.com/ladeng07/ITShowPlatform
 Conflicts:
	Apps/enroll/admin.py
	ITShowPlatform/.gitignore
2022-05-05 23:12:26 +08:00

57 lines
1021 B
Python

from django.contrib import admin
from .models import *
# Register your models here.
class DepartmentAdmin(admin.ModelAdmin):
# 定制哪些字段需要展示
list_display = ('id','name','picture')
# sortable_by # 排序
list_editable = ('name','picture',)
list_per_page = 10
list_max_show_all = 200 # default
search_fields = ['title']
# date_hierarchy = 'create_date'
'''默认空值'''
empty_value_display = 'NA'
'''过滤选项'''
list_filter = ()
class New_memberAdmin(admin.ModelAdmin):
# 定制哪些字段需要展示
list_display = ('id', 'name', 'picture')
# sortable_by # 排序
list_editable = ('name', 'picture',)
list_per_page = 10
list_max_show_all = 200 # default
search_fields = ['title']
# date_hierarchy = 'create_date'
'''默认空值'''
empty_value_display = 'NA'
'''过滤选项'''
list_filter = ()
admin.site.register(Department ,DepartmentAdmin)
admin.site.register(NewMember)