12 lines
238 B
Python
12 lines
238 B
Python
from django.db.models import QuerySet
|
|
from django.utils import timezone
|
|
|
|
|
|
class NewsItemQuerySet(QuerySet):
|
|
|
|
def public(self):
|
|
return self.filter(
|
|
public=True,
|
|
published_at__lt=timezone.now()
|
|
)
|