Input in the terminal :python manage.py createsuperuser
Set the name of the sub application project
@admin.register(Wife)
class WifeAdmin(admin.ModelAdmin):
pass
@admin.register(Children)
class ChildrenAdmin(admin.ModelAdmin):
pass
@admin.register(Brother)
class BrotherAdmin(admin.ModelAdmin):
pass
#1、 Basic registration
class HusbandAdmin(admin.ModelAdmin):
# Note that the added fields must be owned in the model class
list_display = ['name', 'age', 'height', 'wight', 'birthday']
# Set the data entries displayed on each page
list_per_page = 3
# Adjust the position of the option box
# Whether the option box is displayed at the top
actions_on_top = False
# Whether the bottom is displayed
actions_on_bottom = True
# Search box
search_fields = ['name', 'age', 'height']
# Filter bar
list_filter = ['age', 'height']
admin.site.register(Husband, HusbandAdmin)