mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix case where multiple models have the same template
This commit is contained in:
parent
d6116a5377
commit
7ffff24790
1 changed files with 4 additions and 1 deletions
|
@ -164,6 +164,7 @@ order by %s""" % (lim, sort)
|
|||
num = int(val) - 1
|
||||
except:
|
||||
num = None
|
||||
lims = []
|
||||
for m in self.deck.models().values():
|
||||
for t in m.templates:
|
||||
# ordinal number?
|
||||
|
@ -172,10 +173,12 @@ order by %s""" % (lim, sort)
|
|||
found = True
|
||||
# template name?
|
||||
elif t['name'].lower() == val.lower():
|
||||
self.lims['card'].append((
|
||||
lims.append((
|
||||
"(fid in (select id from facts where mid = %d) "
|
||||
"and ord %s %d)") % (m.id, comp, t['ord']))
|
||||
found = True
|
||||
if lims:
|
||||
self.lims['card'].append("(" + " or ".join(lims) + ")")
|
||||
self.lims['valid'] = found
|
||||
|
||||
def _findField(self, token, isNeg):
|
||||
|
|
Loading…
Reference in a new issue