Django-admin数据库记录展示调整
- admin.py
from django.contrib import admin
from user import models
# Register your models here.
class UserInfoAdmin(admin.ModelAdmin):
list_display = ['username','phone_number','email'] # 指定表中的字段进行展示
list_editable = ['phone_number','email'] # 指定哪些字段可以进行修改
admin.site.register(models.UserInfo,UserInfoAdmin)
- 展示效果