1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.views.generic.list_detail import object_list
6 from catalogue.forms import SearchForm
7 from dictionary.models import Note
9 def letter_notes(request, letter=None):
10 letters = ["0-9"] + [chr(a) for a in range(ord('a'), ord('z')+1)]
11 objects = Note.objects.all()
13 objects = objects.filter(sort_key__regex=r"^[0-9]")
15 objects = objects.filter(sort_key__startswith=letter)
17 return object_list(request, queryset=objects, extra_context=locals())