magic-removal: Improved clarity of a test (now possible due to ordering on model)
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2480 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4456e2c26c
commit
242e652fe7
|
@ -221,11 +221,9 @@ datetime.datetime(2005, 7, 28, 0, 0)
|
||||||
# You can combine queries with & and |.
|
# You can combine queries with & and |.
|
||||||
>>> s1 = Article.objects.filter(id__exact=1)
|
>>> s1 = Article.objects.filter(id__exact=1)
|
||||||
>>> s2 = Article.objects.filter(id__exact=2)
|
>>> s2 = Article.objects.filter(id__exact=2)
|
||||||
>>> tmp = [a.id for a in list(s1 | s2)]
|
>>> s1 | s2
|
||||||
>>> tmp.sort()
|
[Area woman programs in Python, Second article]
|
||||||
>>> tmp
|
>>> s1 & s2
|
||||||
[1L, 2L]
|
|
||||||
>>> list(s1 & s2)
|
|
||||||
[]
|
[]
|
||||||
|
|
||||||
# You can get the number of objects like this:
|
# You can get the number of objects like this:
|
||||||
|
|
Loading…
Reference in New Issue