summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-02-08 05:08:06 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-02-08 05:08:06 +0000
commitaddd3df3bd39730cd82c52d9726c9b7dbf1bdb8f (patch)
treee648cbb129dfd103af1d278aaafc0a7007ce95ea /docs
parent0326574d0ecf2eeded92d66855822dd2e602297f (diff)
Fixed #7672 -- Added a 'week_day' lookup type. Many thanks to Ross Poulton for the proposal and implementation on all built-in database backends..
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 1e32552570..d8d01467b9 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1344,6 +1344,27 @@ SQL equivalent::
Note this will match any record with a pub_date on the third day of the month,
such as January 3, July 3, etc.
+week_day
+~~~~~~~~
+
+.. versionadded:: 1.1
+
+For date/datetime fields, a 'day of the week' match.
+
+Example::
+
+ Entry.objects.filter(pub_date__week_day=2)
+
+SQL equivalent::
+
+ SELECT ... WHERE EXTRACT('dow' FROM pub_date) = '2';
+
+(The exact SQL syntax varies for each database engine.)
+
+Note this will match any record with a pub_date that falls on a Monday (day 2
+of the week), regardless of the month or year in which it occurs. Week days
+are indexed with day 1 being Sunday and day 7 being Saturday.
+
isnull
~~~~~~