Ticket #5913: model_choice_field.patch

File model_choice_field.patch, 595 bytes (added by cohcheto@…, 16 years ago)

Patch

  • newforms/models.py

     
    176176            return None
    177177        try:
    178178            value = self.queryset.model._default_manager.get(pk=value)
     179            if not value in self.queryset:
     180                raise self.queryset.model.DoesNotExist
    179181        except self.queryset.model.DoesNotExist:
    180182            raise ValidationError(ugettext(u'Select a valid choice. That choice is not one of the available choices.'))
    181183        return value
Back to Top