fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move source names to a model.
[wolnelektury.git]
/
apps
/
dictionary
/
views.py
diff --git
a/apps/dictionary/views.py
b/apps/dictionary/views.py
index
a2a814b
..
76c89cd
100755
(executable)
--- a/
apps/dictionary/views.py
+++ b/
apps/dictionary/views.py
@@
-11,12
+11,12
@@
class NotesView(ListView):
self.letters = ["0-9"] + [chr(a) for a in range(ord('a'), ord('z')+1)]
self.letter = self.kwargs.get('letter')
self.letters = ["0-9"] + [chr(a) for a in range(ord('a'), ord('z')+1)]
self.letter = self.kwargs.get('letter')
- objects = Note.objects.all()
+ objects = Note.objects.
select_related('book').
all()
if self.letter == "0-9":
objects = objects.filter(sort_key__regex=r"^[0-9]")
elif self.letter:
objects = objects.filter(sort_key__startswith=self.letter)
if self.letter == "0-9":
objects = objects.filter(sort_key__regex=r"^[0-9]")
elif self.letter:
objects = objects.filter(sort_key__startswith=self.letter)
- return
ListView.get_queryset(self)
+ return
objects
def get_context_data(self, **kwargs):
context = super(NotesView, self).get_context_data(**kwargs)
def get_context_data(self, **kwargs):
context = super(NotesView, self).get_context_data(**kwargs)