[1.8.x] Fixed #24323 -- Documented @admin.register can't be used with super(XXXAdmin in __init__().

Backport of 4cd2bdae07 from master
This commit is contained in:
Tim Graham 2015-09-26 20:27:09 -04:00
parent cb2de5e2e9
commit 5ebf6fd891
1 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,13 @@ The register decorator
class PersonAdmin(admin.ModelAdmin):
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
------------------------