1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[soc2009/multidb] Merged up to trunk r11804.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2009-12-09 17:23:16 +00:00
parent 2e900d47f2
commit bee835fa44
53 changed files with 2286 additions and 76 deletions

View File

@@ -211,6 +211,14 @@ True
>>> Article.objects.get(id__exact=8) == Article.objects.get(id__exact=7)
False
# You can use 'in' to test for membership...
>>> a8 in Article.objects.all()
True
# ... but there will often be more efficient ways if that is all you need:
>>> Article.objects.filter(id=a8.id).exists()
True
# dates() returns a list of available dates of the given scope for the given field.
>>> Article.objects.dates('pub_date', 'year')
[datetime.datetime(2005, 1, 1, 0, 0)]