mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-11 03:46:34 +03:00
Accept datetime values for date fields (by Zloool)
This commit is contained in:
parent
cce85beeef
commit
9f2619a807
|
@ -79,6 +79,8 @@ class DateField(Field):
|
|||
def to_python(self, value):
|
||||
if isinstance(value, datetime.date):
|
||||
return value
|
||||
if isinstance(value, datetime.datetime):
|
||||
return value.date()
|
||||
if isinstance(value, int):
|
||||
return DateField.class_default + datetime.timedelta(days=value)
|
||||
if isinstance(value, string_types):
|
||||
|
|
Loading…
Reference in New Issue
Block a user