Created
December 30, 2011 21:37
-
-
Save dnozay/1541581 to your computer and use it in GitHub Desktop.
django admin @register class decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# django admin @register class decorator, e.g. | |
# @register(Entry) | |
# class EntryAdmin(models.ModelAdmin): | |
# pass | |
def register(model): | |
def inner(admin_cls): | |
admin.site.register(model, admin_cls) | |
return admin_cls | |
return inner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment