def allow_syncdb(self, db, model): "Make sure the app only appears on the db where it belongs" if db in APP_ROUTERS.values() and model._meta.app_label in APP_ROUTERS: return APP_ROUTERS[model._meta.app_label] == db elif model._meta.app_label in APP_ROUTERS: return False return None
def db_for_write(self, model, **hints): "Point all operations on forum models to particular database" return APP_ROUTERS.get(model._meta.app_label)