summaryrefslogtreecommitdiff
path: root/testapp/myauthentication/router.py
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/myauthentication/router.py')
-rw-r--r--testapp/myauthentication/router.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/testapp/myauthentication/router.py b/testapp/myauthentication/router.py
new file mode 100644
index 0000000..eeb4cdb
--- /dev/null
+++ b/testapp/myauthentication/router.py
@@ -0,0 +1,12 @@
+class MyDatabaseRouter(object):
+ """
+ A router to manage database operations in the myauthentication app.
+ """
+ def db_for_read(self, model, **hints):
+ """
+ Point all read operations on myauthentication app to spoken
+ database.
+ """
+ if model._meta.app_label == 'myauthentication':
+ return 'spoken'
+ return None