On Sat, 2009-02-21 at 21:58 -0800, ajt111 wrote: > I want to create a multi-dimentional arry in a form element and > convert that to a list of dicts. > > My form element looks like this: > > <input type="checkbox" value="{{result.CODE}}" name="search > [{{result.NAME}}]">
If this as part of a loop? What is result? Does it have CODE and NAME attributes or methods or keys? > > What I was hoping to have was an arry named search with a key of > result.NAME and a value of result.CODE that looks like this: > > > > search > [ > NAME1=>CODE1 > NAME2=>CODE2 > ] Where were you hoping this might show up? There's nowhere that it will appear like this in Django, but if you could explain which step you're talking about (form rendering? data passed back to Django? Inside the view?) it might help us work out what you're trying to do. > > It looks like the name and value fields are not being passed as an > array but as literal string in a dict. where the key is "search[NAME]" > and the value is CODE like this: > > {"search[NAME]":"CODE"} Again, where is this appearing? A few short, but reasonably complete, code fragments demonstrating what you're doing to get these results might help clarify things. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---