diff options
author | prathamesh | 2014-06-06 13:18:33 +0530 |
---|---|---|
committer | prathamesh | 2014-06-06 13:18:33 +0530 |
commit | 7d0753f2e0f590ed4376fdb5f8abaace7c4cfc19 (patch) | |
tree | 6cd9a54277bb7f968c1ab67cf6627802515ec972 /testapp/myauthentication/router.py | |
parent | 8b5d13df2a8f4ac3acc075c522128722b987e57b (diff) | |
parent | c5115d98867504076daacc093d09489033c6a584 (diff) | |
download | online_test-7d0753f2e0f590ed4376fdb5f8abaace7c4cfc19.tar.gz online_test-7d0753f2e0f590ed4376fdb5f8abaace7c4cfc19.tar.bz2 online_test-7d0753f2e0f590ed4376fdb5f8abaace7c4cfc19.zip |
Merge branch 'spoken_tutorial'
Diffstat (limited to 'testapp/myauthentication/router.py')
-rw-r--r-- | testapp/myauthentication/router.py | 12 |
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 |