routers.py 320 B

123456789
  1. class TestRouter(object):
  2. def allow_migrate(self, db, app_label, model_name=None, **hints):
  3. """
  4. The Tribble model should be the only one to appear in the 'other' db.
  5. """
  6. if model_name == 'tribble':
  7. return db == 'other'
  8. elif db == 'other':
  9. return False