title: Django Database routing based on current user logged in
body: <p>In a <code>view</code> class, you could call <code>self.request.user</code> and perform actions based on that. In my case, I would like to be able to switch databases depending on the current user logged in. Is there anyway to inject a <code>self.request</code> call into the <code>db_for_read()</code> and <code>db_for_write()</code> methods like in the following?</p>
  
  <pre><code>class DataBaseRouter(object):
  
      def db_for_read(self, model, **hints):
          user = self.request.user
          if user.id == 1:
              return "master"
          return "default"
  
      def db_for_write(self, model, **hints):
          user = self.request.user
          if user.id == 1:
              return "master"
          return "default"
  </code></pre>