mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix sorting by ease, define any() for python2.4
This commit is contained in:
parent
c7690b68b3
commit
af26bfe69f
1 changed files with 7 additions and 2 deletions
|
@ -171,7 +171,7 @@ where cards.factId = facts.id """
|
||||||
try:
|
try:
|
||||||
self.cards[index.row()] = self.deck.s.first("""
|
self.cards[index.row()] = self.deck.s.first("""
|
||||||
select id, question, answer, due, reps, factId, created, modified,
|
select id, question, answer, due, reps, factId, created, modified,
|
||||||
interval, noCount, factor, priority from cards where id = :id""",
|
interval, factor, noCount, priority from cards where id = :id""",
|
||||||
id=self.cards[index.row()][0])
|
id=self.cards[index.row()][0])
|
||||||
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
||||||
index, self.index(index.row(), 1))
|
index, self.index(index.row(), 1))
|
||||||
|
@ -265,7 +265,7 @@ where cards.factId = facts.id """
|
||||||
return "%0.2f" % self.cards[index.row()][CARD_EASE]
|
return "%0.2f" % self.cards[index.row()][CARD_EASE]
|
||||||
|
|
||||||
def noColumn(self, index):
|
def noColumn(self, index):
|
||||||
return "%d" % self.cards[index.row()][CARD_EASE]
|
return "%d" % self.cards[index.row()][CARD_NO]
|
||||||
|
|
||||||
class StatusDelegate(QItemDelegate):
|
class StatusDelegate(QItemDelegate):
|
||||||
|
|
||||||
|
@ -1289,6 +1289,11 @@ class ChangeModelDialog(QDialog):
|
||||||
# check maps
|
# check maps
|
||||||
fmap = self.getFieldMap()
|
fmap = self.getFieldMap()
|
||||||
cmap = self.getTemplateMap()
|
cmap = self.getTemplateMap()
|
||||||
|
def any(l):
|
||||||
|
for x in l:
|
||||||
|
if x:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
if not cmap or (self.targetModel != self.oldModel and
|
if not cmap or (self.targetModel != self.oldModel and
|
||||||
not fmap):
|
not fmap):
|
||||||
return ui.utils.showInfo(
|
return ui.utils.showInfo(
|
||||||
|
|
Loading…
Reference in a new issue