Source code for arpegio.blog.managers

"""Blog managers."""
from django.db import models
from django.utils.timezone import now


[docs]class PostManager(models.Manager): # pylint: disable=too-few-public-methods """Post manager"""
[docs] def public(self): """Filter the queryset to obtain the public posts.""" return self.filter(status='PB', creation_date__lt=now())
[docs] def sticky(self): """Filter the queryset to obtain the sticky posts.""" return self.filter(sticky=True)