do not implicitly convert strings to dates in DateField
This commit is contained in:
parent
f489f51f62
commit
7201d81d98
1 changed files with 0 additions and 6 deletions
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
import datetime
|
import datetime
|
||||||
from dateutil.parser import parse as parse_dt
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
from weboob.tools.misc import to_unicode
|
from weboob.tools.misc import to_unicode
|
||||||
|
|
@ -182,11 +181,6 @@ class DateField(Field):
|
||||||
def __init__(self, doc, **kwargs):
|
def __init__(self, doc, **kwargs):
|
||||||
Field.__init__(self, doc, datetime.date, datetime.datetime, **kwargs)
|
Field.__init__(self, doc, datetime.date, datetime.datetime, **kwargs)
|
||||||
|
|
||||||
def convert(self, value):
|
|
||||||
if isinstance(value, basestring):
|
|
||||||
return parse_dt(value)
|
|
||||||
return value
|
|
||||||
|
|
||||||
class TimeField(Field):
|
class TimeField(Field):
|
||||||
"""
|
"""
|
||||||
A field which accepts only :class:`datetime.time` and :class:`datetime.time` types.
|
A field which accepts only :class:`datetime.time` and :class:`datetime.time` types.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue