summaryrefslogtreecommitdiff
path: root/testapp/myauthentication/router.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2014-06-06 17:28:57 +0530
committerPrabhu Ramachandran2014-06-06 17:28:57 +0530
commite50eb8426d5f22fd35a2575cd3f4617226bc1a01 (patch)
treeaf75e47255f39402c79ded6f75399a47084584ff /testapp/myauthentication/router.py
parent8b5d13df2a8f4ac3acc075c522128722b987e57b (diff)
parent77caf5d44ab14d56efd4acbc65a6dd2d78c1c1a6 (diff)
downloadonline_test-e50eb8426d5f22fd35a2575cd3f4617226bc1a01.tar.gz
online_test-e50eb8426d5f22fd35a2575cd3f4617226bc1a01.tar.bz2
online_test-e50eb8426d5f22fd35a2575cd3f4617226bc1a01.zip
Merge pull request #24 from prathamesh920/spoken_tutorial
Spoken tutorial authentication
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..3d9c330
--- /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_tutorial'
+ return None