Ticket #13099: ticket_13099_replace_example.diff
File ticket_13099_replace_example.diff, 829 bytes (added by , 15 years ago) |
---|
-
docs/ref/models/querysets.txt
165 165 SELECT ... 166 166 WHERE NOT (pub_date > '2005-1-3' AND headline = 'Hello') 167 167 168 This example excludes all entries whose ``pub_date`` is later than 2005-1-3 169 OR whose headline is "Hello":: 168 See :ref:`complex queries <complex-lookups-with-q>` for example lookups with OR. 170 169 171 Entry.objects.exclude(pub_date__gt=datetime.date(2005, 1, 3)).exclude(headline='Hello')172 173 In SQL terms, that evaluates to::174 175 SELECT ...176 WHERE NOT pub_date > '2005-1-3'177 OR NOT headline = 'Hello'178 179 Note the second example is more restrictive.180 181 170 ``annotate(*args, **kwargs)`` 182 171 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 183 172