2019-12-20 19:49:56 +00:00
|
|
|
class DefaultOtherRouter:
|
|
|
|
def allow_migrate(self, db, app_label, model_name=None, **hints):
|
2022-02-03 19:24:19 +00:00
|
|
|
return db in {"default", "other"}
|
2016-09-01 20:19:29 +00:00
|
|
|
|
|
|
|
|
2017-01-19 07:39:46 +00:00
|
|
|
class TestRouter:
|
2016-01-25 00:23:38 +00:00
|
|
|
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.
|
|
|
|
"""
|
2022-02-03 19:24:19 +00:00
|
|
|
if model_name == "tribble":
|
|
|
|
return db == "other"
|
|
|
|
elif db != "default":
|
2016-01-25 00:23:38 +00:00
|
|
|
return False
|