On Tuesday 27 February 2007 16:35, Mikael Jansson wrote:
> Hi,
>
> I've got an exposed method that gets called with /do?id=N (def do()),
> that displays a form and posts it to /action (@error_handler(do) def
> action()).
>
> Problem is that I want to pass on the ID parameter to the 'action'
> method. How do I do that the most convenient way?
>
> Do I use a table with an extra field? If so, is there a way of adding
> fields to a TableForm /after/ it has been created? This all boils down
> to being able to re-use forms for both creating and editing -- the ID
> field /cannot/ have not_empty=True for the "create" form (as the
> object has not yet been created), however it /must/ have
> not_empty=True for the "edit" form.  Also, per a previous post to this
> group, hidden fields seem to validate as not_empty=False.

Discriminate on value, not on existence. By that I mean that I always have an 
id-field - it's just negative in case of create.

And HiddenFields are vailadated as all other fields as well, I just use

id = widgets.HiddenField(validator=validators.Int(not_empty=True))

all the time.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to