add a default group to model, add groupName()

This commit is contained in:
Damien Elmes 2011-04-04 21:28:28 +09:00
parent f256d18971
commit 6ed48171fc
2 changed files with 4 additions and 0 deletions

View file

@ -556,6 +556,9 @@ update facts set tags = :t, mod = :n where id = :id""", [fix(row) for row in res
"A list of all group names."
return self.db.list("select name from groups order by name")
def groupName(self, id):
return self.db.scalar("select name from groups where id = ?", id)
def groupId(self, name):
"Return the id for NAME, creating if necessary."
id = self.db.scalar("select id from groups where name = ?", name)

View file

@ -11,6 +11,7 @@ from anki.lang import _
defaultConf = {
'sortf': 0,
'gid': 1,
}
defaultField = {