Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I am writing a web applications(simple forms) which has a number of > > fields. Each field naturally has a name and a number of > > attributes(formatting etc.), like this : > > > > d = {'a':{...}, 'b':{....}} > > > > This dict would be passed to the Kid template system which would lay it > > out into a HTML form. For quick and dirty forms, I don't want to code > > each field individually in the HTML template but just from top to > > bottom(or left to right for a table) with a for loop. > > > > However, I still want to group certain fields together. This is my need > > of an ordered dict. > > huh? if you want a list, use a list. > > d = [('a', {...}), ('b', {....})] > Didn't I say that for quick and dirty form(usually first draft), I want a list ? But the same template, it would(may) be further enhanced by graphic designers in which case, I need direct access to the field names, thus the dict property.
In this way, I don't have to change the python code just because I change the presentation in the template. -- http://mail.python.org/mailman/listinfo/python-list