mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
groupConf() takes gcid, not gid
This commit is contained in:
parent
692fba2ea3
commit
11f3de525f
2 changed files with 5 additions and 9 deletions
11
anki/deck.py
11
anki/deck.py
|
@ -568,12 +568,6 @@ update facts set tags = :t, mod = :n where id = :id""", [fix(row) for row in res
|
|||
def delGroup(self, gid):
|
||||
self.db.scalar("delete from groups where id = ?", gid)
|
||||
|
||||
def groupConf(self, gid):
|
||||
return simplejson.loads(
|
||||
self.db.scalar("""
|
||||
select conf from gconf where id = (select gcid from groups where id = ?)""",
|
||||
gid))
|
||||
|
||||
def setGroup(self, cids, gid):
|
||||
self.db.execute(
|
||||
"update cards set gid = ? where id in "+ids2str(cids), gid)
|
||||
|
@ -585,6 +579,11 @@ select conf from gconf where id = (select gcid from groups where id = ?)""",
|
|||
"Return [name, id]."
|
||||
return self.db.all("select name, id from gconf order by name")
|
||||
|
||||
def groupConf(self, gcid):
|
||||
return simplejson.loads(
|
||||
self.db.scalar(
|
||||
"select conf from gconf where id = ?", gcid))
|
||||
|
||||
# Tag-based selective study
|
||||
##########################################################################
|
||||
|
||||
|
|
|
@ -144,9 +144,6 @@ def test_groups():
|
|||
deck.delGroup(2)
|
||||
assert len(deck.groups()) == 1
|
||||
assert deck.groupId("another group") == 3
|
||||
# the newly created group should have a default schedule
|
||||
conf = deck.groupConf(3)
|
||||
assert conf == deck.groupConf(1)
|
||||
# by default, everything should be shown
|
||||
assert not deck.qconf['groups']
|
||||
|
||||
|
|
Loading…
Reference in a new issue