mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
ensure first field can be sorted, flush config out, and ensure schema mod
This commit is contained in:
parent
1b3548f164
commit
e339df5ef8
1 changed files with 3 additions and 1 deletions
|
@ -153,9 +153,11 @@ insert or replace into models values (?, ?, ?, ?, ?, ?, ?)""",
|
|||
return self.conf['sortf']
|
||||
|
||||
def setSortIdx(self, idx):
|
||||
assert idx > 0 and idx < len(self.fields)
|
||||
assert idx >= 0 and idx < len(self.fields)
|
||||
self.conf['sortf'] = idx
|
||||
self.deck.modSchema()
|
||||
self.deck.updateFieldCache(self.fids(), csum=False)
|
||||
self.flush()
|
||||
|
||||
def newField(self):
|
||||
return defaultField.copy()
|
||||
|
|
Loading…
Reference in a new issue