Fixed #10187 -- Added documentation on how to import F() objects. Thanks to trigeek38 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e3d64c6fca
commit
fffade6633
|
@ -508,6 +508,7 @@ For example, to find a list of all blog entries that have had more comments
|
|||
than pingbacks, we construct an ``F()`` object to reference the comment count,
|
||||
and use that ``F()`` object in the query::
|
||||
|
||||
>>> from django.db.models import F
|
||||
>>> Entry.objects.filter(n_pingbacks__lt=F('n_comments'))
|
||||
|
||||
Django supports the use of addition, subtraction, multiplication,
|
||||
|
|
Loading…
Reference in New Issue