dal parse_date should always return date, issue 1344, thanks Niphlod

This commit is contained in:
mdipierro
2013-03-02 12:56:12 -06:00
parent 23af844d5b
commit f79b04884c
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.03.02.12.54.01
Version 2.4.1-alpha.2+timestamp.2013.03.02.12.55.37
+2
View File
@@ -1890,6 +1890,8 @@ class BaseAdapter(ConnectionPool):
return value == True or str(value)[:1].lower() == 't'
def parse_date(self, value, field_type):
if isinstance(value, datetime.datetime):
return value.date()
if not isinstance(value, (datetime.date,datetime.datetime)):
(y, m, d) = map(int, str(value)[:10].strip().split('-'))
value = datetime.date(y, m, d)