Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 Set options after a field is constructed

open
nobody
None
5
2003-03-29
2003-03-29
Stefan Schwarzer
No

I want to be able to set an option in a Field after it
has been constructed, i. e. Field should get a method
setOption(name, value)
e. g.
setOption('hide', 1)
This effect could be accomplished by
def setOption(self, name, value):
self._options[name] = value
in the Field class.

Motivation: Mostly, fields are made once, upon
construction of a FieldDefinition and don't change
after then. However, I have an (or several) situations
where I go through a form and then a preview page to
look at a formatted version of the entered form data
and to confirm that it should be put into the database.

Apart from a submit button, the preview page contains
all the form data from the previous form but as hidden
fields. So I want to use - almost - the same fields
(escpecially including their ValidatorConverter s) for
the form but with the 'hide' option set to 1. I build
my form definitions as mutable ones on the fly, so
there's no problem in modifying a list of Field s. (I
make a copy of the field list.)

Let me know if you need more info.

Stefan

Discussion