mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[multi-db] Minor documentation updates
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b17f250907
commit
ae3896cb74
@ -221,7 +221,7 @@ class ConnectionInfoDescriptor(object):
|
|||||||
connections per instance, and always returns the same connection for an
|
connections per instance, and always returns the same connection for an
|
||||||
instance in particular thread during a particular request.
|
instance in particular thread during a particular request.
|
||||||
|
|
||||||
Any object that includes an attribute ``model`` that holds a model class
|
Any object that includes a ``model`` attribute that holds a model class
|
||||||
can use this descriptor to manage connections.
|
can use this descriptor to manage connections.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -279,6 +279,7 @@ class LocalizingProxy:
|
|||||||
self.__kw = kw
|
self.__kw = kw
|
||||||
|
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
|
# Private (__*) attributes are munged
|
||||||
if attr.startswith('_LocalizingProxy'):
|
if attr.startswith('_LocalizingProxy'):
|
||||||
return self.__dict__[attr]
|
return self.__dict__[attr]
|
||||||
try:
|
try:
|
||||||
@ -289,6 +290,7 @@ class LocalizingProxy:
|
|||||||
return getattr(getattr(self.__storage, self.__name), attr)
|
return getattr(getattr(self.__storage, self.__name), attr)
|
||||||
|
|
||||||
def __setattr__(self, attr, val):
|
def __setattr__(self, attr, val):
|
||||||
|
# Private (__*) attributes are munged
|
||||||
if attr.startswith('_LocalizingProxy'):
|
if attr.startswith('_LocalizingProxy'):
|
||||||
self.__dict__[attr] = val
|
self.__dict__[attr] = val
|
||||||
return
|
return
|
||||||
|
@ -69,8 +69,8 @@ Here's the example above, with ``MODELS``::
|
|||||||
Accessing a model's connection
|
Accessing a model's connection
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
Each manager has a db attribute that can be used to access the model's
|
Each manager has a ``db`` attribute that can be used to access the model's
|
||||||
connection. Access the db attribute of a model's manager to obtain the
|
connection. Access the ``db`` attribute of a model's manager to obtain the
|
||||||
model's currently configured connection.
|
model's currently configured connection.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -587,6 +587,13 @@ locales have different formats. For example, U.S. English would say
|
|||||||
See `allowed date format strings`_. See also DATE_FORMAT, DATETIME_FORMAT,
|
See `allowed date format strings`_. See also DATE_FORMAT, DATETIME_FORMAT,
|
||||||
TIME_FORMAT and YEAR_MONTH_FORMAT.
|
TIME_FORMAT and YEAR_MONTH_FORMAT.
|
||||||
|
|
||||||
|
OTHER_DATABASES
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Default: ``{}``
|
||||||
|
|
||||||
|
Other database connections to use in addition to the default connection. See the `multiple database support docs`_.
|
||||||
|
|
||||||
PREPEND_WWW
|
PREPEND_WWW
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
@ -852,6 +859,7 @@ TIME_FORMAT and MONTH_DAY_FORMAT.
|
|||||||
|
|
||||||
.. _cache docs: http://www.djangoproject.com/documentation/cache/
|
.. _cache docs: http://www.djangoproject.com/documentation/cache/
|
||||||
.. _middleware docs: http://www.djangoproject.com/documentation/middleware/
|
.. _middleware docs: http://www.djangoproject.com/documentation/middleware/
|
||||||
|
.. _muliple database support docs: http://www.djangoproject.com/documentation/multiple_database_support/
|
||||||
.. _session docs: http://www.djangoproject.com/documentation/sessions/
|
.. _session docs: http://www.djangoproject.com/documentation/sessions/
|
||||||
.. _See available choices: http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
|
.. _See available choices: http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
|
||||||
.. _template documentation: http://www.djangoproject.com/documentation/templates_python/
|
.. _template documentation: http://www.djangoproject.com/documentation/templates_python/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user