bornhack-website/news/managers.py

12 lines
238 B
Python
Raw Normal View History

2016-05-30 19:36:14 +00:00
from django.db.models import QuerySet
from django.utils import timezone
2016-05-30 19:36:14 +00:00
class NewsItemQuerySet(QuerySet):
def public(self):
return self.filter(
public=True,
published_at__lt=timezone.now()
2016-05-30 19:36:14 +00:00
)