django/tests/migrations/routers.py

14 lines
358 B
Python
Raw Normal View History

class EmptyRouter(object):
pass
class TestRouter(object):
def allow_migrate(self, db, app_label, model_name=None, **hints):
"""
The Tribble model should be the only one to appear in the 'other' db.
"""
if model_name == 'tribble':
return db == 'other'
elif db == 'other':
return False