mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[soc2009/multidb] Added a using option to a Model's Meta class. This allows you to select the default database for a specific model, in addition to the global default
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11135 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -103,7 +103,7 @@ model handling are exactly the same as normal. This includes
|
||||
unmanaged model, then the intermediate table for the many-to-many join
|
||||
will also not be created. However, a the intermediary table between one
|
||||
managed and one unmanaged model *will* be created.
|
||||
|
||||
|
||||
If you need to change this default behavior, create the intermediary
|
||||
table as an explicit model (with ``managed`` set as needed) and use the
|
||||
:attr:`ManyToManyField.through` attribute to make the relation use your
|
||||
@@ -210,6 +210,17 @@ set of fields::
|
||||
|
||||
unique_together = ("driver", "restaurant")
|
||||
|
||||
``using``
|
||||
---------
|
||||
|
||||
.. attribute:: Options.using
|
||||
|
||||
The alias for the default database to be used for this model. If this is not
|
||||
provided the default is ``'default'``. If it is porvided it can be overidden
|
||||
at the ``QuerySet`` level with the ``using()`` method.
|
||||
|
||||
.. versionadded:: TODO
|
||||
|
||||
``verbose_name``
|
||||
----------------
|
||||
|
||||
@@ -232,4 +243,3 @@ The plural name for the object::
|
||||
verbose_name_plural = "stories"
|
||||
|
||||
If this isn't given, Django will use :attr:`~Options.verbose_name` + ``"s"``.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user