admin.register()
  • References/Python/Django/API/contrib packages/The Django admin site

register(*models, site=django.admin.sites.site) [source] There is also a decorator for registering

2025-01-10 15:47:30
admin.ModelAdmin.get_readonly_fields()
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.get_readonly_fields(request, obj=None) The get_readonly_fields method is given the HttpRequest

2025-01-10 15:47:30
admin.ModelAdmin.radio_fields
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.radio_fields By default, Django’s admin uses a select-box interface (<select>) for fields that are ForeignKey

2025-01-10 15:47:30
admin.StackedInline
  • References/Python/Django/API/contrib packages/The Django admin site

class StackedInline [source] The admin interface has the ability to edit models on the same

2025-01-10 15:47:30
admin.ModelAdmin.get_paginator()
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True) [source]

2025-01-10 15:47:30
admin.ModelAdmin.get_changeform_initial_data()
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.get_changeform_initial_data(request) [source] A hook for the initial data on admin

2025-01-10 15:47:30
admin.ModelAdmin.has_delete_permission()
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.has_delete_permission(request, obj=None) Should return True if deleting obj is permitted, False

2025-01-10 15:47:30
admin.ModelAdmin.list_max_show_all
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.list_max_show_all Set list_max_show_all to control how many items can appear on a “Show all” admin change

2025-01-10 15:47:30
admin.ModelAdmin.list_display
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.list_display Set list_display to control which fields are displayed on the change list page of the admin

2025-01-10 15:47:30
admin.ModelAdmin.get_inline_instances()
  • References/Python/Django/API/contrib packages/The Django admin site

ModelAdmin.get_inline_instances(request, obj=None) [source] The get_inline_instances

2025-01-10 15:47:30