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__.py2
-rw-r--r--django/db/models/fields/related.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index b5245d6624..2f8a8651a1 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -162,7 +162,7 @@ class Field(object):
def get_db_prep_lookup(self, lookup_type, value):
"Returns field's value prepared for database lookup."
- if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'year', 'month', 'day'):
+ if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'year', 'month', 'day', 'search'):
return [value]
elif lookup_type in ('range', 'in'):
return value
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 5f6ec83bb6..6e0fb6d2a8 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -198,7 +198,7 @@ class ForeignRelatedObjectsDescriptor(object):
setattr(obj, rel_field.name, None)
obj.save()
else:
- raise rel_field.rel.to.DoesNotExist, "'%s' is not related to '%s'." % (obj, instance)
+ raise rel_field.rel.to.DoesNotExist, "%r is not related to %r." % (obj, instance)
remove.alters_data = True
def clear(self):
@@ -712,7 +712,7 @@ class ManyToManyRel:
self.related_name = related_name
self.filter_interface = filter_interface
if limit_choices_to is None:
- limit_choices_to = {}
+ limit_choices_to = {}
self.limit_choices_to = limit_choices_to
self.edit_inline = False
self.raw_id_admin = raw_id_admin