fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'pretty' of github.com:fnp/wolnelektury into pretty
[wolnelektury.git]
/
apps
/
dictionary
/
views.py
diff --git
a/apps/dictionary/views.py
b/apps/dictionary/views.py
index
9f00224
..
47204fd
100755
(executable)
--- a/
apps/dictionary/views.py
+++ b/
apps/dictionary/views.py
@@
-3,14
+3,14
@@
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.views.generic.list_detail import object_list
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.views.generic.list_detail import object_list
-from catalogue.forms import SearchForm
from dictionary.models import Note
def letter_notes(request, letter=None):
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()
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())
objects = objects.filter(sort_key__startswith=letter)
return object_list(request, queryset=objects, extra_context=locals())