Skip to content

Commit

Permalink
Fixed #24323 -- Documented @admin.register can't be used with super(X…
Browse files Browse the repository at this point in the history
…XXAdmin in __init__().
  • Loading branch information
timgraham committed Sep 28, 2015
1 parent b7ade64 commit 4cd2bda
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/ref/contrib/admin/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------

Expand Down

0 comments on commit 4cd2bda

Please sign in to comment.