Hi,
I am not able to validate a date using
validators.DateValidator(today_or_after=True), not_empty = True), it
gives me this error:
File
"/usr/lib/python2.4/site-packages/FormEncode-0.5.1-py2.4.egg/formencode/validators.py",
line 837, in validate_python
value_as_date = datetime_makedate(
AttributeError: 'unicode' object has no attribute 'year'
Seems validator expects a datetime while I pass to it a unicode string.
How can I convert this value into a datetime using the following definition?
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)
ricercaForm = NewTableForm(caption='note di
accredito',name='ricercaForm',fields=FindFields(), action =
'submit_ricerca')
jo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---