Django using multi-db with .raw

Thu Feb 23, 2012

Got the error QuerySet does not have raw when trying to do

MyModel.objects.using(‘slave’).raw(‘select …’)

The problem is you have to set the DB onto the db model like this:

MyModel.objects.db_manager(‘slave’).raw(‘…’)