From 7838fd87eb55a23e7b1d403c1d173916a5ade4f4 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 26 Jun 2009 18:16:18 +0000 Subject: [PATCH] [soc2009/multidb] Added the start of documentation for multidb git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11118 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/models/querysets.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 348486b341..7640d5d4ca 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -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 ---------------------------------------------