﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7939	ModelChoiceField gets an error when you pass an String instead of an integer	Oriol Martí	nobody	"When you have a ModelChoiceField field and you pass an String instead of an Integer you have an error. 
If a user sends a string (GET or POST) to the page an error occurs. Here is an example of this error:

>>> from django import newforms as forms
>>> from django.utils.translation import ugettext as _
>>> from satchmo.l10n.models import Country
>>> 
>>> class AdvSearch (forms.Form):
...     country = forms.ModelChoiceField(Country.objects.all(), required=False, label = _(""Country""))
... 
>>> f = AdvSearch({""country"":""gg""})
>>> if f.is_valid():
...     print ""VALID""
... else:
...     print ""NO VALID""
... 
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/home/sinuhe/lib/python2.5/django/newforms/forms.py"", line 95, in is_valid

This error can be corrected if you check the parameters that the user is sending, but I think that the best behavior when this happens is the same if you send an Integer that not exists in the Query.
"		closed	Forms	0.96		duplicate			Unreviewed	0	0	0	0	0	0
