Author: russellm
Date: 2010-05-09 00:13:45 -0500 (Sun, 09 May 2010)
New Revision: 13159
Modified:
django/branches/releases/1.1.X/docs/ref/models/querysets.txt
Log:
[1.1.X] Fixed #13282 -- Clarified documentation around week_day filtering in
querysets. Thanks to wangchun, Ramiro Morales and timo.
Backport of r13155 from trunk.
Modified: django/branches/releases/1.1.X/docs/ref/models/querysets.txt
===================================================================
--- django/branches/releases/1.1.X/docs/ref/models/querysets.txt
2010-05-09 05:13:13 UTC (rev 13158)
+++ django/branches/releases/1.1.X/docs/ref/models/querysets.txt
2010-05-09 05:13:45 UTC (rev 13159)
@@ -1518,16 +1518,16 @@
For date/datetime fields, a 'day of the week' match.
+Takes an integer value representing the day of week from 1 (Sunday) to 7
+(Saturday).
+
Example::
Entry.objects.filter(pub_date__week_day=2)
-SQL equivalent::
+(No equivalent SQL code fragment is included for this lookup because
+implementation of the relevant query varies among different database engines.)
- 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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.