xadmin中注册app 的class

1.引入头文件

from .models import EmailVerifyRecord

2.class

classEmailVerifyRecordAdmin(object):

list_display = ['code','email','send_type','send_time']     展示的列

search_fields = ['code','email','send_type']    搜索列(时间一般不进行搜索,会出错)

list_filter = ['code','email','send_type','send_time']   过滤器

3.注册

xadmin.site.register(EmailVerifyRecord, EmailVerifyRecordAdmin)

你可能感兴趣的:(xadmin中注册app 的class)