Can I have a Django Instance of a project(one setting file) but different database per model or model instance? What do I mean.
Suppose we have a model Business
class Business(models.Model):
#buisness specific fields
A model Employer
class Employer(models.Model):
business = models.ForeignKey(Business)
#other fields
Then I create 3 businesses
business1 = Business.create(#fields kwords heare)
business2 = Business.create(#etc)
business3 = Business.create(#etc)
I want each business to be stored to a different database but on the same server say business1, business2 and business3 respectively.
I also want to have employers but each employer object to be stored to the same data base of its foreign key, so
employer1 = Employer.create(business=business1, #...etc) #store it on table on business1 db
employer2 = Employer.create(business=business2, #....etc) #store it on table on business2 db
employer3 = Employer.create(business=business3, #....etc) #store it on table on business3 db.
Is this possible with Django?