summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-09-26 20:27:09 -0400
committerTim Graham <timograham@gmail.com>2015-09-28 07:26:54 -0400
commit5ebf6fd8918f843756a73581bb88f570c4f5d117 (patch)
tree93a3c79a14f0570f3120e60b0eb2be4f79024120
parentcb2de5e2e983adb7b16a9978222d20e94286827e (diff)
[1.8.x] Fixed #24323 -- Documented @admin.register can't be used with super(XXXAdmin in __init__().
Backport of 4cd2bdae07ac5561fdae0eede58c68df4dfcc780 from master
-rw-r--r--docs/ref/contrib/admin/index.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 29578f6588..9e69138e6e 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -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
------------------------