X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/070d93a055b8dfd594664db308b310785d59af70..ce268f7e02d3c4cfb11f700d2ae179abc151f8ae:/apps/dictionary/views.py?ds=sidebyside diff --git a/apps/dictionary/views.py b/apps/dictionary/views.py index 9f0022475..e12006366 100755 --- a/apps/dictionary/views.py +++ b/apps/dictionary/views.py @@ -8,9 +8,11 @@ from dictionary.models import Note def letter_notes(request, letter=None): form = SearchForm() - letters = [chr(a) for a in range(ord('a'), ord('z')+1)] + letters = ["0-9"] + [chr(a) for a in range(ord('a'), ord('z')+1)] objects = Note.objects.all() - if letter: + if letter == "0-9": + objects = objects.filter(sort_key__regex=r"^[0-9]") + elif letter: objects = objects.filter(sort_key__startswith=letter) return object_list(request, queryset=objects, extra_context=locals())