def _normalize_query_parameter(value):
 if isinstance(value, Model):
  value = value.key()
 if (isinstance(value, datetime.date) and (not isinstance(value, datetime.datetime))):
  value = _date_to_datetime(value)
 elif isinstance(value, datetime.time):
  value = _time_to_datetime(value)
 return value

def _normalize_query_parameter ( value ) : if isinstance ( value , Model ) : value = value . key ( ) if ( isinstance ( value , datetime . date ) and ( not isinstance ( value , datetime . datetime ) ) ) : value = _date_to_datetime ( value ) elif isinstance ( value , datetime . time ) : value = _time_to_datetime ( value ) return value
make any necessary type conversions to a query parameter .