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