Ticket #1372: related.py.patch
File related.py.patch, 1.0 KB (added by , 19 years ago) |
---|
-
Users/mcroydon/django/django_magic/django/db/models/fields/related.py
470 470 471 471 def isValidIDList(self, field_data, all_data): 472 472 "Validates that the value is a valid list of foreign keys" 473 mod = self.rel.to ._meta.get_model_module()473 mod = self.rel.to 474 474 try: 475 475 pks = map(int, field_data.split(',')) 476 476 except ValueError: 477 477 # the CommaSeparatedIntegerField validator will catch this error 478 478 return 479 objects = mod. get_in_bulk(pks)479 objects = mod.objects.in_bulk(pks) 480 480 if len(objects) != len(pks): 481 481 badkeys = [k for k in pks if k not in objects] 482 482 raise validators.ValidationError, ngettext("Please enter valid %(self)s IDs. The value %(value)r is invalid.",