1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

newforms-admin: Merged to trunk [5473].

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2007-06-15 04:02:33 +00:00
parent ec622fc2a9
commit d304ccad8c
24 changed files with 465 additions and 79 deletions

View File

@@ -388,7 +388,7 @@ The lookup parameters (``**kwargs``) should be in the format described in
`Field lookups`_ below. Multiple parameters are joined via ``AND`` in the
underlying SQL statement, and the whole thing is enclosed in a ``NOT()``.
This example excludes all entries whose ``pub_date`` is the current date/time
This example excludes all entries whose ``pub_date`` is later than 2005-1-3
AND whose ``headline`` is "Hello"::
Entry.objects.exclude(pub_date__gt=datetime.date(2005, 1, 3), headline='Hello')
@@ -398,8 +398,8 @@ In SQL terms, that evaluates to::
SELECT ...
WHERE NOT (pub_date > '2005-1-3' AND headline = 'Hello')
This example excludes all entries whose ``pub_date`` is the current date/time
OR whose ``headline`` is "Hello"::
This example excludes all entries whose ``pub_date`` is later than 2005-1-3
AND whose headline is NOT "Hello"::
Entry.objects.exclude(pub_date__gt=datetime.date(2005, 1, 3)).exclude(headline='Hello')
@@ -598,7 +598,7 @@ related ``Person`` *and* the related ``City``::
p = b.author # Doesn't hit the database.
c = p.hometown # Doesn't hit the database.
sv = Book.objects.get(id=4) # No select_related() in this example.
b = Book.objects.get(id=4) # No select_related() in this example.
p = b.author # Hits the database.
c = p.hometown # Hits the database.