Ticket #3575: django_db2.diff
File django_db2.diff, 1.5 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
160 160 "Returns field's value prepared for saving into a database." 161 161 return value 162 162 163 def get_db_prep_lookup(self, lookup_type, value ):163 def get_db_prep_lookup(self, lookup_type, value, skip_prep=False): 164 164 "Returns field's value prepared for database lookup." 165 if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'year', 'month', 'day', 'search') :165 if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'year', 'month', 'day', 'search') or skip_prep: 166 166 return [value] 167 167 elif lookup_type in ('range', 'in'): 168 168 return value -
django/db/models/query.py
907 907 column = field.column 908 908 909 909 where.append(get_where_clause(lookup_type, current_table + '.', column, value)) 910 params.extend(field.get_db_prep_lookup(lookup_type, value)) 910 if hasattr(backend, 'COLUMN_MAPPING') and backend.COLUMN_MAPPING.has_key(lookup_type): 911 skip_prep = True 912 else: 913 skip_prep = False 914 params.extend(field.get_db_prep_lookup(lookup_type, value, skip_prep)) 911 915 912 916 return joins, where, params 913 917