Refactored get_date_extract_sql() to DatabaseOperations.date_extract_sql(). Refs #5106

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-08-19 22:40:06 +00:00
parent 38b5d7f23d
commit aab04a4c2f
10 changed files with 30 additions and 43 deletions

View file

@ -808,7 +808,7 @@ def get_where_clause(lookup_type, table_prefix, field_name, value, db_type):
elif lookup_type in ('range', 'year'):
return '%s BETWEEN %%s AND %%s' % field_sql
elif lookup_type in ('month', 'day'):
return "%s = %%s" % backend.get_date_extract_sql(lookup_type, field_sql)
return "%s = %%s" % connection.ops.date_extract_sql(lookup_type, field_sql)
elif lookup_type == 'isnull':
return "%s IS %sNULL" % (field_sql, (not value and 'NOT ' or ''))
elif lookup_type == 'search':