ansible/roles/radius/templates/local_routers.py.j2

29 lines
752 B
Text
Raw Normal View History

2020-05-21 18:08:20 +02:00
class DbRouter(object):
"""
A router to control all database operations on models in the
auth application.
"""
def db_for_read(self, model, **hints):
"""
Attempts to read remote models go to local database.
"""
return 'local'
2020-05-21 18:08:20 +02:00
def db_for_write(self, model, **hints):
"""
Attempts to write remote models go to the remote database.
"""
return 'default'
2020-05-21 18:08:20 +02:00
def allow_relation(self, obj1, obj2, **hints):
"""
Allow relations involving the remote database
"""
return True
def allow_migrate(self, db, app_label, model_name=None, **hints):
"""
Allow migrations on the remote database
"""
return True