calibre-web-companion/CalibreWebCompanion/library/context_processors.py

20 lines
718 B
Python
Raw Normal View History

2020-07-08 16:22:37 +00:00
from .models import Authors, Tags, Publishers, Languages, Ratings, Series
def filters(request):
unique_authors = Authors.objects.all().order_by('sort')
unique_tags = Tags.objects.all().order_by('name')
unique_publishers = Publishers.objects.all().order_by('name')
unique_languages = Languages.objects.all()
unique_ratings = Ratings.objects.all().order_by('rating')
unique_series = Series.objects.all().order_by('sort')
return {
"unique_authors": unique_authors,
"unique_tags": unique_tags,
"unique_publishers": unique_publishers,
"unique_languages": unique_languages,
"unique_ratings": unique_ratings,
"unique_series": unique_series
}