From 4a2a0b0e21a7f6ae55d0bc70c8cabf047debc927 Mon Sep 17 00:00:00 2001 From: James Bennett Date: Wed, 23 Sep 2009 23:40:12 +0000 Subject: [PATCH] Fixed #11931: Removed mention of nonexistent get_sql() method for arguments to limit_choices_to. Since the correct reference involves undocumented ORM internals, this simply removes the reference entirely in favor of publicly-documented use of Q objects. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11591 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/models/fields.txt | 2 +- docs/topics/db/queries.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 177df12862..0cb5be4b92 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -844,7 +844,7 @@ define the details of how the relation works. current date/time to be chosen. Instead of a dictionary this can also be a :class:`~django.db.models.Q` - object (an object with a :meth:`get_sql` method) for more complex queries. + object for more :ref:`complex queries `. ``limit_choices_to`` has no effect on the inline FormSets that are created to display related objects in the admin. diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt index 5e353b2ec3..968ea7fbc8 100644 --- a/docs/topics/db/queries.txt +++ b/docs/topics/db/queries.txt @@ -622,6 +622,8 @@ To avoid this problem, simply save the ``QuerySet`` and reuse it:: >>> print [p.headline for p in queryset] # Evaluate the query set. >>> print [p.pub_date for p in queryset] # Re-use the cache from the evaluation. +.. _complex-lookups-with-q: + Complex lookups with Q objects ==============================