def published(self, for_user=UNSET, force_exchange=False):
"""
Apply additional filtering of published items over that done in
`PublishingQuerySet.published` to filter based on additional publising
date fields used by Fluent.
"""
if for_user is not UNSET:
return self.visible()
queryset = super(PublishingUrlNodeQuerySet, self).published(
for_user=for_user, force_exchange=force_exchange)
# Exclude by publication date on the published version of items, *not*
# the draft vesion, or we could get the wrong result.
# Exclude fields of published copy of draft items, not draft itself...
queryset = queryset.exclude(
Q(publishing_is_draft=True) & Q(
Q(publishing_linked__publication_date__gt=now())
| Q(publishing_linked__publication_end_date__lte=now())))
# ...and exclude fields directly on published items
queryset = queryset.exclude(
Q(publishing_is_draft=False) & Q(
Q(publication_date__gt=now())
| Q(publication_end_date__lte=now())))
return queryset
评论列表
文章目录