mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 09:06:41 +03:00
Fix bug in date parsing
This commit is contained in:
parent
9489115d6e
commit
4efdcda97b
|
@ -73,7 +73,8 @@ class DateField(Field):
|
||||||
if isinstance(value, int):
|
if isinstance(value, int):
|
||||||
return DateField.class_default + datetime.timedelta(days=value)
|
return DateField.class_default + datetime.timedelta(days=value)
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
# TODO parse '0000-00-00'
|
if value == '0000-00-00':
|
||||||
|
return DateField.min_value
|
||||||
return datetime.datetime.strptime(value, '%Y-%m-%d').date()
|
return datetime.datetime.strptime(value, '%Y-%m-%d').date()
|
||||||
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user