Opened 11 years ago

Closed 11 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 11 years ago by ralphm

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.

comment:2 Changed 11 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 11 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.

Note: See TracTickets for help on using tickets.