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:
|
||||
self.cards[index.row()] = self.deck.s.first("""
|
||||
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])
|
||||
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
||||
index, self.index(index.row(), 1))
|
||||
|
@ -265,7 +265,7 @@ where cards.factId = facts.id """
|
|||
return "%0.2f" % self.cards[index.row()][CARD_EASE]
|
||||
|
||||
def noColumn(self, index):
|
||||
return "%d" % self.cards[index.row()][CARD_EASE]
|
||||
return "%d" % self.cards[index.row()][CARD_NO]
|
||||
|
||||
class StatusDelegate(QItemDelegate):
|
||||
|
||||
|
@ -1289,6 +1289,11 @@ class ChangeModelDialog(QDialog):
|
|||
# check maps
|
||||
fmap = self.getFieldMap()
|
||||
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
|
||||
not fmap):
|
||||
return ui.utils.showInfo(
|
||||
|
|
Loading…
Reference in a new issue