mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Introduced ModelAdmin.get_fields() and refactored get_fieldsets() to use it.
Refs #18681. This also starts the deprecation of ModelAdmin.declared_fieldsets
This commit is contained in:
parent
61ecb5f48a
commit
ebb3e50243
5 changed files with 80 additions and 13 deletions
|
@ -1218,6 +1218,14 @@ templates used by the :class:`ModelAdmin` views:
|
|||
changelist that will be linked to the change view, as described in the
|
||||
:attr:`ModelAdmin.list_display_links` section.
|
||||
|
||||
.. method:: ModelAdmin.get_fields(self, request, obj=None)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``get_fields`` method is given the ``HttpRequest`` and the ``obj``
|
||||
being edited (or ``None`` on an add form) and is expected to return a list
|
||||
of fields, as described above in the :attr:`ModelAdmin.fields` section.
|
||||
|
||||
.. method:: ModelAdmin.get_fieldsets(self, request, obj=None)
|
||||
|
||||
The ``get_fieldsets`` method is given the ``HttpRequest`` and the ``obj``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue