From 76aa4cc8a265ec36c4ae344eab7985193dcde5ee Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 26 Sep 2015 20:27:09 -0400 Subject: [PATCH] [1.9.x] Fixed #24323 -- Documented @admin.register can't be used with super(XXXAdmin in __init__(). Backport of 4cd2bdae07ac5561fdae0eede58c68df4dfcc780 from master --- docs/ref/contrib/admin/index.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 321c6d83ad3..605601147fb 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 ------------------------