summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-11-17 17:00:40 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-11-17 17:00:40 +0000
commitfc47f8c65af80872c5031e20260100efb4afa1e4 (patch)
tree6378bcd114020989dc055cd820746c5497724216
parent0eb31d3dc9435b18680f7a41bc9067685beb8344 (diff)
Fixed #14257 -- removed ManyToManyField.isValidIDList which was completely dead code (unused since magic-removal). Thanks to andrewsk for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/fields/related.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 11c7a5ed9a..3452736162 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -1056,25 +1056,6 @@ class ManyToManyField(RelatedField, Field):
break
return getattr(self, cache_attr)
- def isValidIDList(self, field_data, all_data):
- "Validates that the value is a valid list of foreign keys"
- mod = self.rel.to
- try:
- pks = map(int, field_data.split(','))
- except ValueError:
- # the CommaSeparatedIntegerField validator will catch this error
- return
- objects = mod._default_manager.in_bulk(pks)
- if len(objects) != len(pks):
- badkeys = [k for k in pks if k not in objects]
- raise exceptions.ValidationError(
- ungettext("Please enter valid %(self)s IDs. The value %(value)r is invalid.",
- "Please enter valid %(self)s IDs. The values %(value)r are invalid.",
- len(badkeys)) % {
- 'self': self.verbose_name,
- 'value': len(badkeys) == 1 and badkeys[0] or tuple(badkeys),
- })
-
def value_to_string(self, obj):
data = ''
if obj: