def _date_to_datetime(value):
 if (not isinstance(value, datetime.date)):
  raise TypeError(('Cannot convert to datetime expected date value; received %s' % value))
 return datetime.datetime(value.year, value.month, value.day)

def _date_to_datetime ( value ) : if ( not isinstance ( value , datetime . date ) ) : raise TypeError ( ( 'Cannot convert to datetime expected date value; received %s' % value ) ) return datetime . datetime ( value . year , value . month , value . day )
convert a date to a datetime for datastore storage .