I need to split database to multiple hosts by user ids.
DB1 DB2 DB3
---------------------------
User1 User2 User3
User4 User5 User6
But how can I add all of them to index?
I can’t do it with:
def index_queryset(self):
return self.get_model().objects.all()
Well this of course depends on your app regarding User.
If you have 6 User Models like
User1, User2, ... User6you could do by writing an own manager for model User, which then will return all Users onself.get_model().objects.all()and also could manage your sharded Database.To know what you like to do and how you did so far it would not to have more information about your current setup