On Sun, 2009-02-22 at 18:54 -0800, ajt111 wrote: > In my above example > It returns a dict with the key as "search[{{result.NAME}}] and the > value as "{{result.CODE}}". This does not allow me to refer the the > data that I want as "search".
Does "it" here mean the template that is rendered? Or the form data that is submitted? It sounds like, for some reason, this isn't being run through the template renderer. Could you show the view function that is creating the data to send to the template and the portion of the template that renders the form? > > What I want to end with is a form element that when submitted, will > produce a two dimentional dictionary object that will be similar in > structure to the follow representation: Well, you won't get that. If you're using a CheckBox widget you'll get back a bunch of "names" for those widgets which were selected. > > Here search wold be a dict that is in the POST data: > > search{ > {"Name 1":"Code 1"}, > {"Name 2":"Code 2"}, > } > > P.S. I would be happy with a list or tuple, anything that preserves > the two level structure. I don't understand where this two-level structure is coming from. An HTML form returns a bunch of name/value pairs, essentially and that's the data Django presents to you. The request.POST data structure is basically a dictionary. You can then run through the keys and values there and convert it to some other type of data structure if you like, but maybe that isn't necessary. Again, I'll refer you back to the questions in my original reply. You haven't answered any of them, which is making it hard understand what's going on. 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 -~----------~----~----~----~------~----~------~--~---