<input name="foo" value="one">
<input name="foo" value="two">
Result is stored in request.POST (or you can do same with get params,
?foo=one&foo=two).
for example request.POST.getlist('foo'). Default getitem implementation
returns only last occurence from list.
See:
http://docs.djangoproject.com/en/1.1/ref/request-response/#querydict-objectsfor
more info.
On Sat, Dec 19, 2009 at 2:27 AM, Todd Blanchard <[email protected]> wrote:
> One thing I'm keenly missing from rails is the form input naming convention
> that causes the form values to be converted into a hierarchy. For instance,
>
> <input name="foo[bar]" value"one">
> <input name="foo[baz]" value="two">
>
> will result in the request values being stored as { 'foo' : {'bar' :
> 'one', 'baz' : 'two' }}
>
> this is very handy when updating multiple related objects in a single form
> submit.
>
> Is there a similar facility for django/python or will I need to write it?
>
> -Todd Blanchard
>
> --
>
> 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]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
--
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.