reverse order added in dyn deck

This commit is contained in:
Damien Elmes 2012-09-13 08:01:04 +09:00
parent 59d938bc7e
commit c127f4b3c8
2 changed files with 6 additions and 1 deletions

View file

@ -35,6 +35,7 @@ DYN_BIGINT = 3
DYN_LAPSES = 4 DYN_LAPSES = 4
DYN_ADDED = 5 DYN_ADDED = 5
DYN_DUE = 6 DYN_DUE = 6
DYN_REVADDED = 7
# model types # model types
MODEL_STD = 0 MODEL_STD = 0
@ -80,6 +81,7 @@ def dynOrderLabels():
4: _("Most lapses"), 4: _("Most lapses"),
5: _("Order added"), 5: _("Order added"),
6: _("Order due"), 6: _("Order due"),
7: _("Latest added first"),
} }
def dynExamples(): def dynExamples():

View file

@ -939,10 +939,13 @@ due = odue, odue = 0, odid = 0, usn = ?, mod = ? where %s""" % lim,
t = "lapses desc" t = "lapses desc"
elif o == DYN_ADDED: elif o == DYN_ADDED:
t = "n.id" t = "n.id"
elif o == DYN_REVADDED:
t = "n.id desc"
elif o == DYN_DUE: elif o == DYN_DUE:
t = "c.due" t = "c.due"
else: else:
raise Exception() # if we don't understand the term, default to due order
t = "c.due"
return t + " limit %d" % l return t + " limit %d" % l
def _moveToDyn(self, did, ids): def _moveToDyn(self, did, ids):