Commit fffade66 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

Fixed #10187 -- Added documentation on how to import F() objects. Thanks to...

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
parent e3d64c6f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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,