mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
add schema check to note save
This commit is contained in:
parent
1ec747dbb4
commit
3b0334b04d
1 changed files with 3 additions and 0 deletions
|
@ -26,6 +26,7 @@ class Note(object):
|
||||||
self.flags = 0
|
self.flags = 0
|
||||||
self.data = ""
|
self.data = ""
|
||||||
self._fmap = self.col.models.fieldMap(self._model)
|
self._fmap = self.col.models.fieldMap(self._model)
|
||||||
|
self.scm = self.col.scm
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
(self.guid,
|
(self.guid,
|
||||||
|
@ -43,8 +44,10 @@ from notes where id = ?""", self.id)
|
||||||
self.tags = self.col.tags.split(self.tags)
|
self.tags = self.col.tags.split(self.tags)
|
||||||
self._model = self.col.models.get(self.mid)
|
self._model = self.col.models.get(self.mid)
|
||||||
self._fmap = self.col.models.fieldMap(self._model)
|
self._fmap = self.col.models.fieldMap(self._model)
|
||||||
|
self.scm = self.col.scm
|
||||||
|
|
||||||
def flush(self, mod=None):
|
def flush(self, mod=None):
|
||||||
|
assert self.scm == self.col.scm
|
||||||
self._preFlush()
|
self._preFlush()
|
||||||
self.mod = mod if mod else intTime()
|
self.mod = mod if mod else intTime()
|
||||||
self.usn = self.col.usn()
|
self.usn = self.col.usn()
|
||||||
|
|
Loading…
Reference in a new issue