#18360: Database router example improvement
-------------------------------------+-------------------------------------
     Reporter:  sbaechler            |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  1.4
    Component:  Documentation        |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:  multiple database    |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by sbaechler):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Scratch that example. This would cause all models to sync on the 'other'
 db as well.

 So there can only be one router per db then (should be noted in the docs):


 {{{
      def allow_syncdb(self, db, model):
         "Make sure the myapp app only appears on the 'other' db"
         if db == 'other':
             return model._meta.app_label in ['myapp', 'myotherapp']
         elif model._meta.app_label == 'myapp':
             return False
         return None
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18360#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to