Source code for comments.managers

__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"


from django.db import models

from .constants import STATUS_PENDING


[docs]class CommentQuerySet(models.QuerySet):
[docs] def vetted(self): return self.filter(status__gte=1)
[docs] def awaiting_vetting(self): return self.filter(status=STATUS_PENDING)
[docs] def regular_comments(self): return self.filter(is_author_reply=False)
[docs] def author_replies(self): return self.filter(is_author_reply=True)
[docs] def publicly_visible(self): return self.filter(anonymous=False, status__gte=1)