Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions example/updated/querysets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ def published(self):
from django.utils import timezone
return self.filter(~models.Q(publish_date=None)).filter(publish_date__lte=timezone.now())

class PublishableEmptyQuerySet(models.query.EmptyQuerySet):
def published(self):
return self

class AuthorableQuerySet(models.query.QuerySet):
def authored_by(self, author):
return self.filter(author__username=author)

class AuthorableEmptyQuerySet(models.query.EmptyQuerySet):
def authored_by(self, author):
return self