diff options
| author | Tim Graham <timograham@gmail.com> | 2015-09-26 20:27:09 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-28 07:26:51 -0400 |
| commit | 76aa4cc8a265ec36c4ae344eab7985193dcde5ee (patch) | |
| tree | 0feaa6e5242607b237446d30d0cc0c6cd2f84850 /docs/ref | |
| parent | 6a0b4faf43db70a35163dde0a5ea626ed4129fa7 (diff) | |
[1.9.x] Fixed #24323 -- Documented @admin.register can't be used with super(XXXAdmin in __init__().
Backport of 4cd2bdae07ac5561fdae0eede58c68df4dfcc780 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 321c6d83ad..605601147f 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -125,6 +125,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 ------------------------ |
