Filter fields based on request query parameters.
432976
def fields(self):
        """"""
        fields = super().fields
        return apply_subfield_projection(self, copy.copy(fields))
767536
def queryset(self, request, queryset):
		
		filter_args = {self._filter_arg_key: None}

		if self.value() == "yes":
			return queryset.exclude(**filter_args)
		if self.value() == "no":
			return queryset.filter(**filter_args)
784026
def filter(self, **kwargs):
        """"""
        assert not self._primary_keys
        self.queryset = self.queryset.filter(**kwargs)
        return self
257491
def get_queryset_filters(self, query):
        
        conditions = Q()
        for field_name in self.fields:
            conditions |= Q(**{
                self._construct_qs_filter(field_name): query
            })
        return conditions
250195
def _validate_field(param, fields):
    

    if param.field not in fields:
        raise InvalidQueryParams(**{
            'detail': 'The sort query param value of "%s" is '
                      'invalid. That field does not exist on the '
                      'resource being requested.' % param.raw_field,
            'links': LINK,
            'parameter': PARAM,
        })
1280118
function filter (resources, req) {
  util.debug("There are %d resources in %s", resources.length, req.path);

  if (resources.length > 0) {
    // If there are query params, then filter the collection by them
    let queryParams = _.filter(req.swagger.params, { in: "query" });
    if (queryParams.length > 0) {
      // Build the filter object
      let filterCriteria = { data: {}};
      queryParams.forEach((param) => {
        if (req.query[param.name] !== undefined) {
          setDeepProperty(filterCriteria.data, param.name, req.query[param.name]);
        }
      });

      if (!_.isEmpty(filterCriteria.data)) {
        // Filter the collection
        util.debug("Filtering resources by %j", filterCriteria.data);
        resources = _.filter(resources, filterCriteria);
        util.debug("%d resources matched the filter criteria", resources.length);
      }
    }
  }

  return resources;
}
1210454
function filterQuery(query = {}, ...keys) {
  const out = {};
  keys.forEach((key) => {
    if (query[key] !== undefined && query[key] !== null) {
      out[key] = query[key];
    }
  });
  return out;
}
824375
def filter(self, table, items, filter_string):
        """"""
        query = filter_string.lower()
        return [item for item in items
                if query in item.name.lower()]
928939
def filter(self, criteria: Q, offset: int = 0, limit: int = 10, order_by: list = ()):
        """"""

        if criteria.children:
            items = list(self._filter(criteria, self.conn['data'][self.schema_name]).values())
        else:
            items = list(self.conn['data'][self.schema_name].values())

        # Sort the filtered results based on the order_by clause
        for o_key in order_by:
            reverse = False
            if o_key.startswith('-'):
                reverse = True
                o_key = o_key[1:]
            items = sorted(items, key=itemgetter(o_key), reverse=reverse)

        result = ResultSet(
            offset=offset,
            limit=limit,
            total=len(items),
            items=items[offset: offset + limit])
        return result
1029761
def filter(self, endpoint, params):
        
        params = self.parse_params(params)
        params = urlencode(params)
        path = '{0}?{1}'.format(endpoint, params)
        return self.get(path)
1186551
public function filterRecords()
    {
        if ($this->autoFilter && $this->request->isSearchable()) {
            $this->filtering();
        } else {
            if (is_callable($this->filterCallback)) {
                call_user_func($this->filterCallback, $this->filterCallbackParameters);
            }
        }


        $this->columnSearch();
        $this->filteredRecords = $this->isFilterApplied ? $this->count() : $this->totalRecords;
    }
614615
def _filter(self, query, **kwargs):
        
        query = self._auto_filter(query, **kwargs)
        return query
793008
def make_filter(self, fieldname, query_func, expct_value):
        '''  '''

        def actual_filter(item):
            value = getattr(item, fieldname)

            if query_func in NULL_AFFECTED_FILTERS and value is None:
                return False

            if query_func == 'eq':
                return value == expct_value
            elif query_func == 'ne':
                return value != expct_value
            elif query_func == 'lt':
                return value < expct_value
            elif query_func == 'lte':
                return value <= expct_value
            elif query_func == 'gt':
                return value > expct_value
            elif query_func == 'gte':
                return value >= expct_value
            elif query_func == 'startswith':
                return value.startswith(expct_value)
            elif query_func == 'endswith':
                return value.endswith(expct_value)

        actual_filter.__doc__ = '{} {} {}'.format('val', query_func, expct_value)

        return actual_filter
420520
def filter_resource(self, resource_name, field_name, field_value,
                        result_handler=ONE_RESULT):
        
        return self.multi_filter_resource(resource_name,
                                          {field_name: field_value},
                                          result_handler=result_handler)
534347
def filter_queryset(self, request, queryset, view):
        
        if request.user.is_superuser:
            return queryset
        return queryset.filter(status__user=request.user)
406727
private Map<String, String> getQueryParams(Request request) {
        final Map<String, String> queryParams = new HashMap<>();
        request.queryMap().toMap().forEach((k, v) -> {
            queryParams.put(k, v[0]);
        });
        return queryParams;
    }
203774
def parse_querystring(self, req, name, field):
        """"""
        return core.get_value(req.GET, name, field)