Re: Dynamic database routing in Django

2014-03-12 Thread Xavier Ordoquy
Hi Philip, I'm not sure your sharding will be possible in the way you describe it. There will be cases for which selecting the database will not be possible. For example, Customer.objects.get(name=) won't be able which DB you'll need to hit to get the result. Same goes for a new Customer. H

Dynamic database routing in Django

2014-03-12 Thread Philip Goh
Hello list, In my database, I have a `Customer` table defined in my database that all other tables are foreign keyed on. class Customer(models.Model): ... class TableA(models.Model): Customer = models.ForeignKey(Customer) ... class TableB(models.Model):