Skip to content

Commit

Permalink
Fix datetime types in value_to_python.
Browse files Browse the repository at this point in the history
  • Loading branch information
douglatornell authored and benoitc committed Mar 13, 2011
1 parent 429c1c1 commit e71efb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions couchdbkit/schema/properties.py
Expand Up @@ -782,11 +782,11 @@ def value_to_python(value, item_type=None):
"""
data_type = None
if isinstance(value, basestring):
if re_date.match(value) and is_type_ok(item_type, datetime.datetime):
if re_date.match(value) and is_type_ok(item_type, datetime.date):
data_type = datetime.date
elif re_time.match(value) and is_type_ok(item_type, datetime.date):
elif re_time.match(value) and is_type_ok(item_type, datetime.time):
data_type = datetime.time
elif re_datetime.match(value) and is_type_ok(item_type, datetime.time):
elif re_datetime.match(value) and is_type_ok(item_type, datetime.datetime):
data_type = datetime.datetime
elif re_decimal.match(value) and is_type_ok(item_type, decimal.Decimal):
data_type = decimal.Decimal
Expand Down

0 comments on commit e71efb8

Please sign in to comment.