On 1/13/07, jose <[EMAIL PROTECTED]> wrote:
I am not able to validate a date using
[...]
class FindFields(widgets.WidgetsList):
data_na = NewCalendarDatePicker( name = "data_na",
label = 'Data emissione nota accredito:',
default = None,
validator = DateValidator(today_or_after=True),
not_empty = True)
This is because you need to do something like this instead:
class FindFields(widgets.WidgetsList):
data_na = CalendarDatePicker( name = "data_na",
label = 'Data emissione nota accredito:',
default = None,
format = '%d%m%Y'
validator = DateTimeConverter(format='%d%m%Y'),)
then on the action handler you add a decorator for validating the
date_na parameter received:
@validate(form=A_REFERENCE_TO_YOUR_FORM_INSTANCE)
@validate(validators={'data_na':validators.DateValidator(today_or_after=True)})
hope it helps :)
Regards,
Florent Aide
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---