diff --git a/django/forms/models.py b/django/forms/models.py
index 01bd912..450f95e 100644
a
|
b
|
class ModelMultipleChoiceField(ModelChoiceField):
|
738 | 738 | if not isinstance(value, (list, tuple)): |
739 | 739 | raise ValidationError(self.error_messages['list']) |
740 | 740 | final_values = [] |
| 741 | qs = self.queryset.filter(pk__in=value) |
| 742 | pks = set([force_unicode(o.pk) for o in qs]) |
741 | 743 | for val in value: |
742 | | try: |
743 | | obj = self.queryset.get(pk=val) |
744 | | except self.queryset.model.DoesNotExist: |
| 744 | if force_unicode(val) not in pks: |
745 | 745 | raise ValidationError(self.error_messages['invalid_choice'] % val) |
746 | | else: |
747 | | final_values.append(obj) |
748 | | return final_values |
| 746 | return qs |