def _validate_timestamp_fields(query, field_name, operator_list, allow_timestamps):
 for item in query:
  if (item.field == field_name):
   if (not allow_timestamps):
    raise wsme.exc.UnknownArgument(field_name, ('not valid for ' + 'this resource'))
   if (item.op not in operator_list):
    raise wsme.exc.InvalidInput('op', item.op, ('unimplemented operator for %s' % item.field))
   return True
 return False

def _validate_timestamp_fields ( query , field_name , operator_list , allow_timestamps ) : for item in query : if ( item . field == field_name ) : if ( not allow_timestamps ) : raise wsme . exc . UnknownArgument ( field_name , ( 'not valid for ' + 'this resource' ) ) if ( item . op not in operator_list ) : raise wsme . exc . InvalidInput ( 'op' , item . op , ( 'unimplemented operator for %s' % item . field ) ) return True return False
validates the timestamp related constraints in a query if there are any .