summaryrefslogtreecommitdiff
path: root/django/db/models/fields
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/fields')
-rw-r--r--django/db/models/fields/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 274b5b4327..41e8c06b80 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -201,7 +201,7 @@ class Field(object):
sql, params = value.as_sql()
return QueryWrapper(('(%s)' % sql), params)
- if lookup_type in ('regex', 'iregex', 'month', 'day', 'search'):
+ if lookup_type in ('regex', 'iregex', 'month', 'day', 'week_day', 'search'):
return [value]
elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):
return [self.get_db_prep_value(value)]
@@ -490,9 +490,9 @@ class DateField(Field):
curry(cls._get_next_or_previous_by_FIELD, field=self, is_next=False))
def get_db_prep_lookup(self, lookup_type, value):
- # For "__month" and "__day" lookups, convert the value to a string so
- # the database backend always sees a consistent type.
- if lookup_type in ('month', 'day'):
+ # For "__month", "__day", and "__week_day" lookups, convert the value
+ # to a string so the database backend always sees a consistent type.
+ if lookup_type in ('month', 'day', 'week_day'):
return [force_unicode(value)]
return super(DateField, self).get_db_prep_lookup(lookup_type, value)