if model._meta.app_label == 'myapp' and model._meta.object_name == 'ModelInDatabase2Name': That is - instead of just checking the app, check the app and the model name. Install the router, and any query involving ModelInDatabase2Name will be directed to the 'other' database.
It would be helpful to add this to the documentation, as only routing certain models to a different DB may be quite frequent. I found this out this week by looking at the db sources and after finding nothing in the docs.
Trying to import models.py from the app in the router module leads to problems as the router is set up at db module initialization, so db and db.util try to import each other without success. Mentioning this could save some time for those trying db routing for the first time.
Jani -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.