Return queryset limited to not removed entries.
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)
1117506
def _get_django_queryset(self):
        """"""

        prefetches = []
        for field, fprefetch in self.prefetches.items():
            has_query = hasattr(fprefetch, 'query')
            qs = fprefetch.query.queryset if has_query else None
            prefetches.append(
                Prefetch(field, queryset=qs)
            )

        queryset = self.queryset
        if prefetches:
            queryset = queryset.prefetch_related(*prefetches)

        return queryset
464296
def get_queryset(self, request):
        ''' '''
        qs = super(SubmissionFileAdmin, self).get_queryset(request)
        if request.user.is_superuser:
            return qs
        else:
            return qs.filter(Q(submissions__assignment__course__tutors__pk=request.user.pk) | Q(submissions__assignment__course__owner=request.user)).distinct()
240173
def get_queryset(self):
        
        queryset    = super(IndexView, self).get_queryset()
        search_form = self.get_search_form()

        if search_form.is_valid():
            query_str   = search_form.cleaned_data.get('q', '').strip()
            queryset    = self.model.objects.search(query_str)

        return queryset
728395
def search_queryset(self):
        """"""
        queryset = self.get_model_class().objects.get_queryset()

        if self.get_model_config().list_select_related:
            queryset = queryset.select_related(*self.get_model_config().list_select_related)

        return watson.filter(queryset, self.get_search(), ranking=False)
948711
def get(self, *args, **kwargs) -> "QuerySet":
        
        queryset = self.filter(*args, **kwargs)
        queryset._limit = 2
        queryset._get = True
        return queryset
1292896
def queryset(self, request, queryset):
        
        if self.value():
            try:
                section = SectionPage.objects.get(id=self.value())
                return queryset.child_of(section).all()
            except (ObjectDoesNotExist, MultipleObjectsReturned):
                return None
580430
def where_entry_deleted(query):
    
    return orm.select(
        e for e in query
        if e.status == model.PublishStatus.GONE.value)
974881
def get_queryset(self):
        
        queryset = super(LiveEntryCategoryManager, self).get_queryset()
        return queryset.filter(tag__in=[
            entry_tag.tag
            for entry_tag
            in EntryTag.objects.filter(entry__live=True)
        ])
1008724
def get_queryset(self):
        
        self.forum = self.get_forum()
        qs = (
            self.forum.topics
            .exclude(type=Topic.TOPIC_ANNOUNCE)
            .exclude(approved=False)
            .select_related('poster', 'last_post', 'last_post__poster')
        )
        return qs
753452
def limit(self, limit):
        
        query = self._copy()
        query._limit = limit
        return query
646691
def exclude_current_instance(self, queryset):
        
        if self.instance is not None:
            return queryset.exclude(pk=self.instance.pk)
        return queryset
151293
def get_queryset(self):
        
        return ForumVisibilityContentTree.from_forums(
            self.request.forum_permission_handler.forum_list_filter(
                Forum.objects.all(), self.request.user,
            ),
        )
955308
def get_queryset(self, request):
        
        qs = super(FormAdmin, self).get_queryset(request)
        return qs.annotate(total_entries=Count("entries"))
1000255
def get_queryset(self):
        
        queryset = super(DeleteImageView, self).get_queryset()
        queryset = queryset.filter(user=self.user)
        return queryset
161197
def get_queryset(self):
        
        self.queryset = super(EntryCategoryListView, self).get_queryset()
        return self.get_ordered_entries(self.queryset)
487038
def get_queryset(self):
        
        forums = self.request.forum_permission_handler.get_readable_forums(
            Forum.objects.all(), self.request.user,
        )
        topics = Topic.objects.filter(forum__in=forums)
        topics_pk = map(lambda t: t.pk, track_handler.get_unread_topics(topics, self.request.user))
        return Topic.approved_objects.filter(pk__in=topics_pk).order_by('-last_post_on')