Skip to content

Commit

Permalink
[soc2009/multidb] Added the start of documentation for multidb
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
alex committed Jun 26, 2009
1 parent 1b18321 commit 7838fd8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/ref/models/querysets.txt
Expand Up @@ -874,6 +874,24 @@ logically::
# existing set of fields).
Entry.objects.defer("body").only("headline", "body")

``using(alias)``
~~~~~~~~~~~~~~~~~~

.. versionadded:: 1.2

This method is for controlling which database the ``QuerySet`` will be
evaluated against if you are using more than one database. The only argument
this method takes is the alias of a database, as defined in
:settings:`DATABASES`.

For example::

# queries the database with the 'default' alias.
>>> Entry.objects.all()

# queries the database with the 'backup' alias
>>> Entry.objects.using('backup')


QuerySet methods that do not return QuerySets
---------------------------------------------
Expand Down

0 comments on commit 7838fd8

Please sign in to comment.