From 84d59e4b0153e6c62d7378e8287561931db2b6f0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 14 Apr 2011 08:12:38 +0900 Subject: [PATCH] don't truncate sort field anymore, since we display it in the gui --- anki/consts.py | 5 ----- anki/deck.py | 3 +-- anki/models.py | 1 - anki/template/README.anki | 2 ++ 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/anki/consts.py b/anki/consts.py index 8744a41ab..faf1d24a3 100644 --- a/anki/consts.py +++ b/anki/consts.py @@ -2,8 +2,6 @@ # Copyright: Damien Elmes # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -MATURE_THRESHOLD = 21 - # whether new cards should be mixed with reviews, or shown first or last NEW_CARDS_DISTRIBUTE = 0 NEW_CARDS_LAST = 1 @@ -22,9 +20,6 @@ REV_CARDS_OLD_FIRST = 0 REV_CARDS_NEW_FIRST = 1 REV_CARDS_RANDOM = 2 -# maximum characters to store in sort cache -SORT_FIELD_LEN = 20 - # Labels ########################################################################## diff --git a/anki/deck.py b/anki/deck.py index e6726036c..85fa100e1 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -431,8 +431,7 @@ select id from cards where fid in (select id from facts where mid = ?)""", for f in model.fields: if f['uniq'] and fields[f['ord']]: r.append((fid, mid, fieldChecksum(fields[f['ord']]))) - r2.append((stripHTML(fields[model.sortIdx()])[ - :SORT_FIELD_LEN], fid)) + r2.append((stripHTML(fields[model.sortIdx()]), fid)) if csum: self.db.execute("delete from fsums where fid in "+sfids) self.db.executemany("insert into fsums values (?,?,?)", r) diff --git a/anki/models.py b/anki/models.py index 4c8633b53..3344762a4 100644 --- a/anki/models.py +++ b/anki/models.py @@ -280,7 +280,6 @@ select id from facts where mid = ?)""" % " ".join(map), self.id) ########################################################################## # - maps are ord->ord, and there should not be duplicate targets # - newModel should be self if model is not changing - # - interface should ensure there's at least one remaining card def changeModel(self, fids, newModel, fmap, cmap): self.deck.modSchema() diff --git a/anki/template/README.anki b/anki/template/README.anki index efd8d0969..2c775ee5f 100644 --- a/anki/template/README.anki +++ b/anki/template/README.anki @@ -4,3 +4,5 @@ Behaviour is a little different from standard Mustache: - {{text}} returns text verbatim with no HTML escaping - {{{text}}} strips an outer span tag - partial rendering is disabled for security reasons +- certain keywords like 'cloze' are treated specially +