Malcolm, exactly, I'm trying to submit a complex form, albeit through
a GET request. For the moment I've worked around the problem seeing as
i only need to go 2 levels deep at the moment. When the need arises
for an 'n' amount of depths I'll be writing such a function indeed.

Mike, thanks. Reading that made me realize a recursion limit would be
a much needed feature.

Regards,
Simon

On May 3, 6:08 pm, Mike Axiak <[EMAIL PROTECTED]> wrote:
> Actually,
> doing something similar to this was actually a source of a DoS attack
> on PHP [1]. It does seem to me one of the features of Django that
> there is little processing done to the actual request.
>
> Cheers,
> Mike Axiak
>
> 1:http://www.php-security.org/MOPB/MOPB-03-2007.html
>
> On May 3, 11:58 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Thu, 2007-05-03 at 15:43 +0000, simonbun wrote:
> > > Suppose the following query parameters:
> > > myurl/?var=1&var=2&var=3
>
> > > Running this through QueryDict correctly gives me
> > > <MultiValueDict: {'var': ['1', '2', '3']}>
>
> > > I had hoped that multiple levels in these variables would result in a
> > > nested dictionary, but no such luck. To illustrate the problem lets
> > > suppose the following query:
>
> > > myurl/?
> > > countries[visited]=us&countries[visited]=dk&countries[notvisited]=be
>
> > > It gets parsed as
> > > <MultiValueDict: {'countries[visited]': ['us', 'dk'],
> > > 'countries[notvisited]': ['be']}>
>
> > > yet i would have hoped:
> > > <MultiValueDict: {'countries': {'visited': ['us', 'dk'], 'notvisited':
> > > ['be']}}>
>
> > > I'm thinking it would be better to have QueryDict recurse through the
> > > values instead of just parsing one level deep. Is there a way to
> > > achieve what I want, or is this handled at the mod_python level?
>
> > Trying to impose Python syntax on URLs doesn't seem like a good idea to
> > me (it leads to somewhat opaque URLs, for a start). Presumably you are
> > talking about this more in the sense of form submission, so let's think
> > of it as POST data, rather than URLs.
>
> > You could write a function that takes Django's standard MultiValueDict
> > and returns the type of nested structure you are after. Not a change
> > worth making in core, but it's only a function you would have to write
> > once for your own use.
>
> > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to