Opened 13 years ago
Closed 12 years ago
#58 closed defect (worksforme)
Option sorting in data forms
Reported by: | ff | Owned by: | ralphm |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | generic | Keywords: | |
Cc: |
Description
The options parameter in the Field constructor is a dictionary. This doesn't allow controlling the order they are displayed.
Change History (3)
comment:1 Changed 13 years ago by ralphm
comment:2 Changed 13 years ago by ff
Sorry the description was too short and perhaps confusing. I didn't mean the "fields" parameter in the Form constructor (I see right now the problem, since I usually add fields with addField), but I meant the "options" parameter in the Field constructor. That is a dict and it breaks the order of option display in list-* fields
comment:3 Changed 12 years ago by ralphm
- Resolution set to worksforme
- Status changed from new to closed
The options parameter to Field.__init__ can take a dict or a list of Options. If order is important, you could use something like twisted.python.util.OrderedDict or provide a list of Options.
The field argument to __init__ is not a dict, but a list. The instance variable is a dict though, as documented. I could change the name of the argument to fieldList, to coincide with the instance variable, but I have to check if that breaks stuff.