delete unreferenced tags on update

This commit is contained in:
Damien Elmes 2009-03-23 10:21:48 +09:00
parent c7022fd37d
commit 80464ab4a5

View file

@ -1542,6 +1542,9 @@ facts.modelId = :id""", id=modelId))
insert into cardTags
(cardId, tagId, src) values
(:cardId, :tagId, :src)""", d)
self.s.statement("""
delete from tags where id not in (select distinct tagId from cardTags)
""")
def updateTagsForModel(self, model):
cardIds = self.s.column0("""