This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/context_processors.py

9 lines
246 B
Python

from articles.models import Article, Page
def pages(request):
return {"pages": Page.objects.filter(status=Article.PUBLISHED)}
def drafts_count(request):
return {"drafts_count": Article.with_pages.filter(status=Article.DRAFT).count()}