#18360: Database router example improvement
-------------------------------------+-------------------------------------
     Reporter:  sbaechler            |                    Owner:  nobody
         Type:                       |                   Status:  reopened
  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):

 * cc: simon@… (added)
 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Hi Russel

 I agree, my example was unclear and my usecase maybe too specific.
 Although having several apps that all need access to the 'other' database
 should not be too uncommon.

 Anyway, this does not change the fact that I think the multi-db docs is
 not deep enough for developers to fully understand the concept of database
 routers. Here that particular example is the ''only'' example on how to
 use routers.

 Let me explain: What guided me in the wrong direction was the naming of
 your example router class. Because it is named MyAppRouter it implied to
 me that you are going to need a router for every app. Which turned out to
 be wrong. Because if you do that, you won't get syncdb or dumpdata for
 every app that is not in the first router in the list. So if it would have
 been named 'OtherDbRouter' I would have instinctively used only one router
 for all apps that use the 'other' db, which turned out to be the correct
 solution.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18360#comment:3>
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