This is hopefully an easy question.
I'm having some trouble understanding the documentation for the new multiple database feature in Django 1.2. Primarily, I cant seem to find an example of how you actually USE the second database in one of your models.
When I define a new class in my models.py how do I specify which database I intend on connecting to?
My settings.py contains something similar to -
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'modules',
'USER': 'xxx',
'PASSWORD': 'xxx',
},
'asterisk': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'users',
'USER': 'xxxx',
'PASSWORD': 'xxxx',
}
}
Edit: I was reading the documentation on routers like a dummy. If anyone else is struggling with this just make sure you read it 2 or 3 times before giving up!