just change:from django.contrib import adminfrom models import *import modelsimport inspectfrom django.db.models.base import ModelBasefrom django.contrib.admin.sites import AlreadyRegisteredfor name, obj in inspect.getmembers(models ):if inspect.isclass(obj):if isinstance(obj, ModelBase):if not obj._meta.abstract:try:admin.site.register(obj)except AlreadyRegistered:pass
from models import *
import models
and
inspect.getmembers(models )
1 comment:
Pretty great post. I simply stumbled upon your blog and wanted
to say that I have really loved surfing around your blog posts.
After all I'll be subscribing for your feed and I'm hoping you write again
very soon!
Here is my web blog ... adobe
Post a Comment