I've got an error using ModelMultipleChoiceField, but don't guess
where:
my form is :
class SearchForm(forms.Form):
titulos = forms.ModelMultipleChoiceField(Titulo.objects.all
().order_by('tipo'), label='Títulos')
in my template I insert it with:
<form method="POST" action="/curriculums/buscarCurriculum">
{% for field in form %}
<span>{{ field.label_tag }}</span>
<span>{{ field }}</span>
{% endfor %}
<span><input type="image" src="/media/img/admin/icon_addlink.gif"
alt="Submit button"></span>
</form>
but when I try to get values in my view:
if request.POST:
num=len(request.POST['titulos'])
titulos=[ Titulo.objects.filter(pk=i) for i in request.POST
['titulos']
post=request.POST
I get the next values:
titulos: [<Titulo: Licenciatura, Biología>] (note that's only one)
num: 1
POST: <QueryDict: {u'y': [u'2'], u'titulos': [u'1', u'2'], u'x':
[u'9']}>
It seems that POST is ok, but cannot process it
¿any help?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---