mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
loop should exit early, and allNames() doesn't need modification
This commit is contained in:
parent
6c304ebe2f
commit
7aee582a58
1 changed files with 3 additions and 2 deletions
|
@ -124,8 +124,8 @@ class ModelManager(object):
|
||||||
"Get all models."
|
"Get all models."
|
||||||
return self.models.values()
|
return self.models.values()
|
||||||
|
|
||||||
def allNames(self, curm=None):
|
def allNames(self):
|
||||||
return [m['name'] for m in self.all() if m!=curm]
|
return [m['name'] for m in self.all()]
|
||||||
|
|
||||||
def byName(self, name):
|
def byName(self, name):
|
||||||
"Get model with NAME."
|
"Get model with NAME."
|
||||||
|
@ -171,6 +171,7 @@ select id from cards where nid in (select id from notes where mid = ?)""",
|
||||||
if (mcur['name'] == m['name'] and
|
if (mcur['name'] == m['name'] and
|
||||||
mcur['id'] != m['id']):
|
mcur['id'] != m['id']):
|
||||||
m['name'] += "-" + checksum(str(time.time()))[:5]
|
m['name'] += "-" + checksum(str(time.time()))[:5]
|
||||||
|
break
|
||||||
|
|
||||||
def update(self, m):
|
def update(self, m):
|
||||||
"Add or update an existing model. Used for syncing and merging."
|
"Add or update an existing model. Used for syncing and merging."
|
||||||
|
|
Loading…
Reference in a new issue