Created
September 27, 2010 02:51
-
-
Save michaelschade/598529 to your computer and use it in GitHub Desktop.
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
# Change to import the proper model object | |
from package import models | |
# Leave alone | |
from django.db.models.base import ModelBase | |
from django.contrib import admin | |
from inspect import getmembers | |
for model in getmembers(models): | |
if type(model[1]) == ModelBase: # model[1] is the actual object | |
admin.site.register(model[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment