Filter the given pages :class:`QuerySet` to obtain only published
        page.
19874
def filter_published(self, queryset):
        """"""
        if settings.PAGE_USE_SITE_ID:
            queryset = queryset.filter(sites=global_settings.SITE_ID)

        queryset = queryset.filter(status=self.model.PUBLISHED)

        if settings.PAGE_SHOW_START_DATE:
            queryset = queryset.filter(publication_date__lte=get_now())

        if settings.PAGE_SHOW_END_DATE:
            queryset = queryset.filter(
                Q(publication_end_date__gt=get_now()) |
                Q(publication_end_date__isnull=True)
            )

        return queryset
784983
def only_published(cls, at=None):
		
		
		if isinstance(at, timedelta):
			at = utcnow() + at
		else:
			at = at or utcnow()
		
		pub, ret = cls.published, cls.retracted
		
		publication = (-pub) | (pub == None) | (pub <= at)
		retraction = (-ret) | (ret == None) | (ret > at)
		
		return publication & retraction
168237
def page(self):
        
        if not self._page:
            try:
                self._page = self.paginator.page(
                    self.query_dict.get('page', 1))
            except InvalidPage:
                raise HttpError("Invalid page", status=HTTP_400_BAD_REQUEST)
        return self._page
318512
def published(self, for_user=None):
        
        if appsettings.FLUENT_BLOGS_FILTER_SITE_ID:
            qs = self.parent_site(settings.SITE_ID)
        else:
            qs = self

        if for_user is not None and for_user.is_staff:
            return qs

        return qs \
            .filter(status=self.model.PUBLISHED) \
            .filter(
                Q(publication_date__isnull=True) |
                Q(publication_date__lte=now())
            ).filter(
                Q(publication_end_date__isnull=True) |
                Q(publication_end_date__gte=now())
            )
789597
def exclude(self, *args, **kwargs) -> "QuerySet":
        
        return self._filter_or_exclude(negate=True, *args, **kwargs)
385662
def get_queryset(self):
        '''
        
        '''
        queryset = super(PageList, self).get_queryset()
        if hasattr(self.request, 'site_id'):
            queryset = queryset.filter(site_id=self.request.site_id)
        return queryset
1278514
def get_children_for_page(self, page):
        """"""
        if self.max_levels == 1:
            # If there's only a single level of pages to display, skip the
            # dict creation / lookup and just return the QuerySet result
            return self.pages_for_display
        return super().get_children_for_page(page)
856490
def make_published(self, request, queryset):
        
        cnt1 = queryset.filter(
            date_published__isnull=True,
            publish=False,
        ).update(date_published=timezone.now(), publish=True)
        cnt2 = queryset.filter(
            date_published__isnull=False,
            publish=False,
        ).update(publish=True)
        messages.add_message(
            request, messages.INFO,
            __('%(updates)d entry published.',
                '%(updates)d entries published.', cnt1+cnt2) % {
                'updates':  cnt1+cnt2, })
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
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)
1267406
def queryset(self, request, queryset):
        
        if self.value() is not None:
            return queryset.filter(information__type__pk=self.value())
        else:
            return queryset
1093537
def get_by_page(query, page, page_size):
    
    pager = Paginator(query, page_size)

    try:
        models = pager.page(page)
    except PageNotAnInteger:
        # If page is not an integer, deliver first page.
        models = pager.page(1)
    except EmptyPage:
        # If page is out of range (e.g. 9999), deliver last page of results.
        models = pager.page(pager.num_pages)

    return models
795092
def make_published(self, request, queryset):
        
        queryset.update(status=PUBLISHED)
        EntryPublishedVectorBuilder().cache_flush()
        self.ping_directories(request, queryset, messages=False)
        self.message_user(
            request, _('The selected entries are now marked as published.'))
784026
def filter(self, **kwargs):
        """"""
        assert not self._primary_keys
        self.queryset = self.queryset.filter(**kwargs)
        return self
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
1060168
def on_site(self, site_id=None):
        
        if settings.PAGES_USE_SITE_ID:
            if not site_id:
                site_id = settings.SITE_ID
            return self.get_queryset().filter(sites=site_id)
        return self.all()
49415
def get_queryset(self):
        
        self.tag = get_tag(self.kwargs['tag'])
        if self.tag is None:
            raise Http404(_('No Tag found matching "%s".') %
                          self.kwargs['tag'])
        return TaggedItem.objects.get_by_model(
            Entry.published.all(), self.tag)