mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
store field to compare against in type answer
This commit is contained in:
parent
28b0a7b8d3
commit
222503ea8f
2 changed files with 3 additions and 3 deletions
|
@ -1746,7 +1746,7 @@ select id from fields where factId not in (select id from facts)""")
|
|||
# these sometimes end up null on upgrade
|
||||
self.s.statement("update models set source = 0 where source is null")
|
||||
self.s.statement(
|
||||
"update cardModels set allowEmptyAnswer = 1, typeAnswer = 0 "
|
||||
"update cardModels set allowEmptyAnswer = 1, typeAnswer = '' "
|
||||
"where allowEmptyAnswer is null or typeAnswer is null")
|
||||
# fix any priorities
|
||||
self.updateProgress(_("Updating priorities..."))
|
||||
|
@ -1997,7 +1997,7 @@ class DeckStorage(object):
|
|||
"decks add column newCount integer not null default 0",
|
||||
"decks add column revCardOrder integer not null default 0",
|
||||
"cardModels add column allowEmptyAnswer boolean not null default 1",
|
||||
"cardModels add column typeAnswer boolean not null default 0"):
|
||||
"cardModels add column typeAnswer text not null default ''"):
|
||||
try:
|
||||
s.execute("alter table " + st)
|
||||
except:
|
||||
|
|
|
@ -105,7 +105,7 @@ cardModelsTable = Table(
|
|||
Column('editAnswerFontSize', Integer, default=None),
|
||||
# empty answer
|
||||
Column('allowEmptyAnswer', Boolean, nullable=False, default=True),
|
||||
Column('typeAnswer', Boolean, nullable=False, default=False))
|
||||
Column('typeAnswer', UnicodeText, nullable=False, default=""))
|
||||
|
||||
class CardModel(object):
|
||||
"""Represents how to generate the front and back of a card."""
|
||||
|
|
Loading…
Reference in a new issue