mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Made the database master router tolerant of router definitions that omit individual routing methods.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12304 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b0d218e9e2
commit
c8873bbba7
3 changed files with 62 additions and 10 deletions
|
@ -99,7 +99,7 @@ routing scheme.
|
|||
Database routers
|
||||
----------------
|
||||
|
||||
A database Router is a class that provides four methods:
|
||||
A database Router is a class that provides up to four methods:
|
||||
|
||||
.. method:: db_for_read(model, **hints)
|
||||
|
||||
|
@ -141,6 +141,10 @@ A database Router is a class that provides four methods:
|
|||
the router has no opinion. This method can be used to determine
|
||||
the availability of a model on a given database.
|
||||
|
||||
A router doesn't have to provide *all* these methods - it omit one or
|
||||
more of them. If one of the methods is omitted, Django will skip that
|
||||
router when performing the relevant check.
|
||||
|
||||
.. _topics-db-multi-db-hints:
|
||||
|
||||
Hints
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue