Skip to content

Instantly share code, notes, and snippets.

@dnozay
Created December 30, 2011 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnozay/1541581 to your computer and use it in GitHub Desktop.
Save dnozay/1541581 to your computer and use it in GitHub Desktop.
django admin @register class decorator
# 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