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

14 lines
315 B
Python
Raw Normal View History

2020-08-17 09:57:24 +02:00
from articles.models import Article, Page
def pages(request):
return {"pages": Page.objects.filter(status=Article.PUBLISHED)}
2020-08-18 14:23:51 +02:00
def drafts_count(request):
return {"drafts_count": Article.objects.filter(status=Article.DRAFT).count()}
def date_format(request):
2020-08-25 23:15:08 +02:00
return {"CUSTOM_ISO": r"Y-m-d\TH:i:sO"}