In the same MySQL server we have a database for each client. This databases share the same table structure. We were able to create a Model for table Foo that looks like this:
class Foo(models.Model):
id = models.AutoField(primary_key=True)
bar = models.CharField(max_length=50)
class Meta:
managed = False
db_table = 'foobar'
Our Django project needs to manage all of our clients. As all of them have the same structure we would also like to share the Foo model. At the begging we were able to handle this issue by defining in the project settings each client's database and using routers. At the moment we have too many clients to have them all defined in setting.py.
Is there any reasonable way to tell the model which schema has to be used every time we use it?