mirror of
https://github.com/django/django.git
synced 2025-11-03 13:23:19 +00:00
Fixed #24323 -- Documented @admin.register can't be used with super(XXXAdmin in __init__().
This commit is contained in:
parent
b7ade64529
commit
4cd2bdae07
1 changed files with 7 additions and 0 deletions
|
|
@ -125,6 +125,13 @@ The register decorator
|
||||||
class PersonAdmin(admin.ModelAdmin):
|
class PersonAdmin(admin.ModelAdmin):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
You can't use this decorator if you have to reference your model admin
|
||||||
|
class in its ``__init__()`` method, e.g.
|
||||||
|
``super(PersonAdmin, self).__init__(*args, **kwargs)``. If you are using
|
||||||
|
Python 3 and don't have to worry about supporting Python 2, you can
|
||||||
|
use ``super().__init__(*args, **kwargs)`` . Otherwise, you'll have to use
|
||||||
|
``admin.site.register()`` instead of this decorator.
|
||||||
|
|
||||||
Discovery of admin files
|
Discovery of admin files
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue