[Zope-dev] Order of Form Keys in REQUEST

Sandra Chong sandra.chong at b-online.com.au
Wed Mar 10 18:56:03 EST 2004


Thank you so much. :D You guys are legends. I will try keeping a separate
ordered list and save it in the session for the form handler to refer to.
Many thanks again. :)

Sandra.

> -----Original Message-----
> From: Chris Withers [mailto:lists at simplistix.co.uk]
> Sent: Wednesday, 10 March 2004 11:19 PM
> To: Max M
> Cc: Sandra Chong; zope-dev at zope.org
> Subject: Re: [Zope-dev] Order of Form Keys in REQUEST
>
>
> Max M wrote:
>
> > Dictionary keys are unordered.
> >
> > You need to store the order of the keys somewhere else. Ie. to have a
> > list in your form with the keys in order, Or to name them
> alphabetically
> > and then sort the keys.
>
> ...or just do something like:
>
> keys = REQUEST.form.keys()
> keys.sort()
> for key in keys:
>    print key
>    print REQUEST.form[key]
>
> return printed
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Zope & Python Consulting
>             - http://www.simplistix.co.uk
>
>




More information about the Zope-Dev mailing list