1
0
mirror of https://github.com/django/django.git synced 2024-12-23 09:36:06 +00:00
django/tests/migrations/routers.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
454 B
Python
Raw Normal View History

class DefaultOtherRouter:
def allow_migrate(self, db, app_label, model_name=None, **hints):
return db in {"default", "other"}
class TestRouter:
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 != "default":
return False