Filter the queryset.

        This is the main entry-point to this class, and
        is called by DRF's list handler.
515244
def filter_queryset(self, request, queryset, view):
        
        self.request = request
        self.view = view

        # enable addition of extra filters (i.e., a Q())
        # so custom filters can be added to the queryset without
        # running into https://code.djangoproject.com/ticket/18437
        # which, without this, would mean that filters added to the queryset
        # after this is called may not behave as expected
        extra_filters = self.view.get_extra_filters(request)

        disable_prefetches = self.view.is_update()

        self.DEBUG = settings.DEBUG

        return self._build_queryset(
            queryset=queryset,
            extra_filters=extra_filters,
            disable_prefetches=disable_prefetches,
        )
771355
def get_queryset(self):
        
        kwargs = {'model': self.model, 'using': self._db}
        if hasattr(self, '_hints'):
            kwargs['hints'] = self._hints

        return self._queryset_class(**kwargs).filter(is_removed=False)
182199
def for_model(self, model, **kwargs):
        
        queryset = self.filter(
            content_types=ContentType.objects.get_for_model(model),
            **kwargs
        )
        return queryset
844341
def get_queryset(self):
        

        query_params = self.request.query_params
        url_params = self.kwargs

        # get queryset_filters from FilterMixin
        queryset_filters = self.get_db_filters(url_params, query_params)

        # This dict will hold filter kwargs to pass in to Django ORM calls.
        db_filters = queryset_filters['db_filters']

        # This dict will hold exclude kwargs to pass in to Django ORM calls.
        db_excludes = queryset_filters['db_excludes']

        queryset = Team.objects.prefetch_related(
            'players'
        ).all()

        return queryset.filter(**db_filters).exclude(**db_excludes)
238807
def queryset(self, request, queryset):
        form = self.get_form(request)

        
        self.form = form

        start_date = form.start_date()
        end_date = form.end_date()

        if form.is_valid() and (start_date or end_date):
            args = self.__get_filterargs(
                start=start_date,
                end=end_date,
            )
            return queryset.filter(**args)
948711
def get(self, *args, **kwargs) -> "QuerySet":
        
        queryset = self.filter(*args, **kwargs)
        queryset._limit = 2
        queryset._get = True
        return queryset
60345
def filter_queryset(self, queryset):
        
        for name, filt in self.filters.items():
            val = self.values.get(name, None)
            if name is None:
                continue
            params = filt.filter_params(val)
            if not params:
                continue
            if isinstance(params, dict):
                queryset = queryset.filter(**params)
            if isinstance(params, QNode):
                queryset = queryset.filter(params)
        return queryset
87059
def filter(self, value=None, model=None, context=None):
        
        if value is None:
            return value
        for filter_obj in self.filters:
            value = filter_obj.filter(
                value=value,
                model=model,
                context=context if self.use_context else None
            )
        return value
839476
def get_queryset(self):
        
        queryset = super(UpdateImageView, self).get_queryset()
        queryset = queryset.filter(user=self.user)
        return queryset
618321
def filter(self, model=None, context=None):
        
        if model is None:
            return

        # properties
        self.filter_properties(model, context=context)

        # entities
        self.filter_entities(model, context=context)

        # collections
        self.filter_collections(model, context=context)
1337072
def get_list_filter(self, request):
        
        list_filter = super(VersionedAdmin, self).get_list_filter(request)
        return list(list_filter) + [('version_start_date', DateTimeFilter),
                                    IsCurrentFilter]
784026
def filter(self, **kwargs):
        """"""
        assert not self._primary_keys
        self.queryset = self.queryset.filter(**kwargs)
        return self
1321899
def get_queryset(self):
        
        return self.queryset.all().accessible_to(user=self.request.user)
558100
def get_queryset(self, request):
        
        if request.GET.get(ShowHistoryFilter.parameter_name) == '1':
            queryset = self.model.objects.with_active_flag()
        else:
            # Show only the most recent row for each key.
            queryset = self.model.objects.current_set()
        ordering = self.get_ordering(request)
        if ordering:
            return queryset.order_by(*ordering)
        return queryset
1216047
def by_name(queryset, name=None):
  
  if name:
    queryset = queryset.filter(name=name)
  return queryset
1149687
def get_queryset(self):
        '''
        
        '''
        request = self.request

        # Allow pages to be filtered to a specific type
        if 'type' not in request.GET:
            model = Page
        else:
            model_name = request.GET['type']
            try:
                model = resolve_model_string(model_name)
            except LookupError:
                raise BadRequestError("type doesn't exist")
            if not issubclass(model, Page):
                raise BadRequestError("type doesn't exist")

        # This is the overwritten line
        queryset = model.objects.public()  # exclude .live()

        # Filter by site
        queryset = queryset.descendant_of(
            request.site.root_page, inclusive=True)

        return queryset
749382
protected function filterRecords()
    {
        if ($this->autoFilter && $this->request->isSearchable()) {
            $this->filtering();
        }

        if (is_callable($this->filterCallback)) {
            call_user_func($this->filterCallback, $this->resolveCallbackParameter());
        }

        $this->columnSearch();
        $this->filteredRecords = $this->isFilterApplied ? $this->filteredCount() : $this->totalRecords;
    }