fnp
/
copyspeak.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
css fix
[copyspeak.git]
/
src
/
words
/
models.py
diff --git
a/src/words/models.py
b/src/words/models.py
index
a1c5fbd
..
cc1b1c1
100644
(file)
--- a/
src/words/models.py
+++ b/
src/words/models.py
@@
-31,15
+31,13
@@
class Word(models.Model):
def get_next(self):
try:
def get_next(self):
try:
- return Word.objects.filter(
alignment=self.alignment,
word__gt=self.word)[0]
+ return Word.objects.filter(word__gt=self.word)[0]
except IndexError:
except IndexError:
- next_alignment = ALIGNMENTS[([a[0] for a in ALIGNMENTS].index(self.alignment) + 1) % len(ALIGNMENTS)][0]
- return Word.objects.filter(alignment=next_alignment)[0]
+ return Word.objects.all()[0]
def get_previous(self):
words = Word.objects.order_by('-word')
try:
def get_previous(self):
words = Word.objects.order_by('-word')
try:
- return words.filter(
alignment=self.alignment,
word__lt=self.word)[0]
+ return words.filter(word__lt=self.word)[0]
except IndexError:
except IndexError:
- prev_alignment = ALIGNMENTS[([a[0] for a in ALIGNMENTS].index(self.alignment) - 1) % len(ALIGNMENTS)][0]
- return words.filter(alignment=prev_alignment)[0]
+ return words[0]