thanks a lot chris,

it's working :).

alex

On Wed, Oct 29, 2008 at 10:35, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
> alex bodnaru wrote:
>> indeed i see that i wish to provide that fiel a value ;) .
>>
>> but how can i set the field's default value to it's validator, to be
>> used in case that field is missing?
>
> Try out:
>
> @expose()
> @validate(validators=dict(myfield=validators.String(if_empty='default')))
> def foo(self, myfield, ...):
>    ...
>
> or
>
> myform = widgets.TableForm(
>    fields=[
>        widgets.TextField('myfield',
>           validator=validators.String(if_missing='default'))
>    ]
> )
>
> @expose()
> @validate(form=myform)
> def foo(self, myfield, ...):
>    ...
>
>
> Please also read the FormEncode documentation at
>
> http://formencode.org/
>
>
> Chris
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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