Your Ad Here

Wednesday, January 18, 2012

Missing something obvious? Question about forms

I have a largish API I have to implement from a standard, and it requires very complex HTTP processing.  I'd like to use django.forms.Form for that, but I can't figure out how to use a form to store a list of parameters.  

So while my homemade code might be:

foo = int(request.get('foo', '1'))
bar = request.getlist(bar)

I can't figure out the corresponding Form class.  What I would *want* is something like this:

class MyForm(Form):
   foo = IntegerField()
   bar = ListField(CharField)

but there is no "ListField"  How is this normally handled?

-- Jeff

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 comments:

Post a Comment