class RegRouter:
def db_for_read(self, model, **hints):
if model._meta.db_table == 'registrations_table':
return 'registrations'
return None
def db_for_write(self, model, **hints):
if model._meta.db_table == 'registrations_table':
return 'registrations'
return None
def allow_migrate(self, db, app_label, model_name=None, **hints):
if db == 'registrations' and model_name == 'registration':
return True
if db == 'registrations' and model_name != 'registration':
return False
if db == 'default' and model_name == 'registration':
return False
else:
return True