Show links on cards, cycle alphabetically
[copyspeak.git] / src / words / models.py
index a1c5fbd..cc1b1c1 100644 (file)
@@ -31,15 +31,13 @@ class Word(models.Model):
 
     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:
-            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:
-            return words.filter(alignment=self.alignment, word__lt=self.word)[0]
+            return words.filter(word__lt=self.word)[0]
         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]