Skip to content

Commit

Permalink
Minor update to documentation for many-to-many filter() calls.
Browse files Browse the repository at this point in the history
Removed a potential ambiguity when describing how multiple conditions in one
filter() call are handled.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Mar 3, 2009
1 parent d79655b commit 5e8ddd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/topics/db/queries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ the primary model, not necessarily those objects that were selected by an
earlier ``filter()`` call.

That may sound a bit confusing, so hopefully an example will clarify. To
select all blogs that contains entries with *"Lennon"* in the headline and
were published in 2008, we would write::
select all blogs that contain entries with both *"Lennon"* in the headline
and that were published in 2008 (the same entry satisfying both conditions),
we would write::

Blog.objects.filter(entry__headline__contains='Lennon',
entry__pub_date__year=2008)
Expand Down

0 comments on commit 5e8ddd5

Please sign in to comment.