Django: Creating a model instance when duplicate model names exist
In one of my views I am importing models from two apps:
from mysite.business.models import Location
from mysite.directory.models import Location
As you can see, both Models have the same name. If I want to create an instance of one of these models, how do I define which one I requi开发者_如何学Gore?
Give them different names.
from mysite.business.models import Location as BusinessLocation
from mysite.directory.models import Location as DirectoryLocation
精彩评论