Returns a list of Q objects that can be passed
        to an queryset for filtering.

        Default implementation returns a Q
        object for `base_filter_kwargs` and any
        passed in keyword arguments.
551591
def get_filter(self, **filter_kwargs):
        
        filter_kwargs.update(self.base_filter_kwargs)
        if filter_kwargs:
            return [models.Q(**filter_kwargs)]
        return []
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)
413695
def filter(self, request, queryset, view):
        
        summary_queryset = queryset
        filtered_querysets = []
        for queryset in summary_queryset.querysets:
            filter_class = self._get_filter(queryset)
            queryset = filter_class(request.query_params, queryset=queryset).qs
            filtered_querysets.append(queryset)

        summary_queryset.querysets = filtered_querysets
        return summary_queryset
1374273
def querystring(self):
        
        return {key: value for (key, value) in self.qs.items()
                if key.startswith(self.MANAGED_KEYS) or self._get_key_values('filter[')}
1367991
def get_queryset(self):
        """"""
        if 'sign' in self.request.query_params:
            try:
                filter_and_actions = unsign_filters_and_actions(
                    self.request.query_params['sign'],
                    '{}.{}'.format(
                        self.queryset.model._meta.app_label,
                        self.queryset.model._meta.model_name,
                    )
                )
            except signing.BadSignature:
                return super(SignedViewSetMixin, self).get_queryset()
            else:
                for filtered_action in filter_and_actions:
                    try:
                        qs = self.queryset.filter(**filtered_action['filters'])
                    except FieldError:
                        continue
                    return qs
        return super(SignedViewSetMixin, self).get_queryset()
1294359
def filter(self, **kwargs):
        
        readFilter = ReadFilter(**kwargs)
        self._filters.append(readFilter.filter)
        return self
1339632
def get_default_queryset(self):
        
        return self.__class__.objects.exclude(pk=self.pk) \
                                     .filter(default=True)
289453
def get_filter_kwargs(self):
        
        if self.is_valid():
            filter_kwargs = {}
            for field in self.get_filter_fields():
                empty_values = EMPTY_VALUES
                if hasattr(self.fields[field], 'empty_values'):
                    empty_values = self.fields[field].empty_values

                value = self.cleaned_data.get(field)
                if not value in empty_values:
                    if self.search_fields and field in self.search_fields:
                        filter_kwargs["%s__icontains" % field] = value
                    else:
                        filter_kwargs[field] = value
            return filter_kwargs
        else:
            return {}
628895
def filter(self, *args, **kwargs):
        
        clone = self._clone()
        for f in args:
            clone.filter_obj.add_filter(f)
        for key, value in kwargs.items():
            clone.filter_obj.add_filter_param(key, value)
        return clone
108651
def get_form_kwargs(self):
        
        kwargs = {"initial": self.get_initial()}
        if self.request.method == "GET":
            kwargs.update({"data": self.request.GET})
        kwargs.update({"searchqueryset": self.get_query_set()})
        return kwargs
505105
def get_query(self, q, request):
        
        return Group.objects.filter(
            Q(name__icontains=q)
            | Q(description__icontains=q)
        )
1254997
def model_to_select_list(model_class, filter_dict=None, q_filter=None):
    
    if filter_dict is None:
        filter_dict = {}

    if q_filter is not None:
        filter_list = [q_filter]
    else:
        filter_list = []

    objects = model_class.objects.filter(
        *filter_list, **filter_dict).values('id', 'name')

    return list(objects)
763071
def get_query_kwargs(es_defs):
    
    rtn_dict = {}
    if es_defs:
        if es_defs.get("kds_esSpecialUnion"):
            rtn_dict['special_union'] = \
                    es_defs["kds_esSpecialUnion"][0]
        if es_defs.get("kds_esQueryFilter"):
            rtn_dict['filters'] = \
                    es_defs["kds_esQueryFilter"][0]
    return rtn_dict
416131
def get_queryset(self):
        '''
        
        '''
        model_type = self.request.GET.get("type")
        pk = self.request.GET.get("id")
        content_type_model = ContentType.objects.get(model=model_type.lower())
        Model = content_type_model.model_class()
        model_obj = Model.objects.filter(id=pk).first()
        return Comment.objects.filter_by_object(model_obj)
1269842
def get_queryset(self):
        
        qs = LogEntry.objects.all()
        content_id = get_query_params(self.request).get("content", None)
        if content_id:
            qs = qs.filter(object_id=content_id)
        return qs
1242899
def kwargs(self):
        
        keywords = self.keywords or []
        return [keyword for keyword in keywords if keyword.arg is None]
581051
def get_object(self, queryset=None):
        
        # Determine the base queryset to use.
        assert queryset is None, "Passing a queryset is disabled"
        queryset = self.filter_queryset(self.get_queryset())

        # Perform the lookup filtering.
        lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
        lookup = self.kwargs.get(lookup_url_kwarg, None)
        assert lookup is not None, "Other lookup methods are disabled"
        filter_kwargs = {self.lookup_field: lookup}
        obj = self.get_object_or_404(queryset, **filter_kwargs)

        # May raise a permission denied
        self.check_object_permissions(self.request, obj)

        return obj