Skip to content

Commit fc47f8c

Browse files
committed
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
1 parent 0eb31d3 commit fc47f8c

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

django/db/models/fields/related.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,25 +1056,6 @@ def _get_m2m_reverse_attr(self, related, attr):
10561056
break
10571057
return getattr(self, cache_attr)
10581058

1059-
def isValidIDList(self, field_data, all_data):
1060-
"Validates that the value is a valid list of foreign keys"
1061-
mod = self.rel.to
1062-
try:
1063-
pks = map(int, field_data.split(','))
1064-
except ValueError:
1065-
# the CommaSeparatedIntegerField validator will catch this error
1066-
return
1067-
objects = mod._default_manager.in_bulk(pks)
1068-
if len(objects) != len(pks):
1069-
badkeys = [k for k in pks if k not in objects]
1070-
raise exceptions.ValidationError(
1071-
ungettext("Please enter valid %(self)s IDs. The value %(value)r is invalid.",
1072-
"Please enter valid %(self)s IDs. The values %(value)r are invalid.",
1073-
len(badkeys)) % {
1074-
'self': self.verbose_name,
1075-
'value': len(badkeys) == 1 and badkeys[0] or tuple(badkeys),
1076-
})
1077-
10781059
def value_to_string(self, obj):
10791060
data = ''
10801061
if obj:

0 commit comments

Comments
 (0)