IS_DATE() formatter sets
d = datetime.date(year, value.month, value.day)
and if self.timezone is not None it calls d.replace with the tzinfo
keyword, this results in the exception:
File "/home/www-data/web2py/gluon/validators.py", line 2263, in formatter
d = d.replace(tzinfo=utc).astimezone(self.timezone)
TypeError: 'tzinfo' is an invalid keyword argument for this function
Changing *d* to be a datetime.datetime instance returns the formatted date.
The relevant field is:
Field('deadline', 'date', requires=IS_DATE(timezone=pytz.timezone(
'America/Chicago'),
format='%Y-%m-%d'))
Should I be doing anything differently or does IS_DATE() need to be changed?
Web2py: 2.8.2-stable+timestamp.2013.11.28.13.54.07
Python: 2.7.3
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.