[cvs-annodex] commit (/annodex): cmmlwiki/trunk/cmmlwiki/item.py
conrad
nobody at lists.annodex.net
Fri Dec 23 11:23:36 EST 2005
Update of /annodex (new revision 1729)
Modified files:
cmmlwiki/trunk/cmmlwiki/item.py
Log Message:
in item delete, delete meta tags associated with clips and head
Modified: cmmlwiki/trunk/cmmlwiki/item.py
===================================================================
--- cmmlwiki/trunk/cmmlwiki/item.py 2005-12-22 23:51:33 UTC (rev 1728)
+++ cmmlwiki/trunk/cmmlwiki/item.py 2005-12-23 00:23:36 UTC (rev 1729)
@@ -78,6 +78,27 @@
sql = 'DELETE FROM item_sources WHERE ixi="%(ixi)s"'
cur.execute (sql, vals)
+ # Delete metas of clips
+ sql = """DELETE FROM metas
+ WHERE ixm IN (
+ SELECT metas.ixm FROM metas,clip_metas
+ WHERE clip_metas.ixm=metas.ixm
+ AND clip_metas.ixc IN (
+ SELECT ixc FROM item_clips
+ WHERE ixi="%(ixi)s"
+ )
+ )
+ """
+ cur.execute (sql, vals)
+
+ sql = """DELETE FROM clip_metas
+ WHERE ixc IN (
+ SELECT ixc FROM item_clips
+ WHERE ixi="%(ixi)s"
+ )
+ """
+ cur.execute (sql, vals)
+
# Delete clips
sql = """DELETE FROM clips
WHERE ixc IN (
@@ -90,6 +111,27 @@
sql = 'DELETE FROM item_clips WHERE ixi="%(ixi)s"'
cur.execute (sql, vals)
+ # Delete metas of heads
+ sql = """DELETE FROM metas
+ WHERE ixm IN (
+ SELECT metas.ixm FROM metas,head_metas
+ WHERE head_metas.ixm=metas.ixm
+ AND head_metas.ixh IN (
+ SELECT ixh FROM item_heads
+ WHERE ixi="%(ixi)s"
+ )
+ )
+ """
+ cur.execute (sql, vals)
+
+ sql = """DELETE FROM head_metas
+ WHERE ixh IN (
+ SELECT ixh FROM item_heads
+ WHERE ixi="%(ixi)s"
+ )
+ """
+ cur.execute (sql, vals)
+
# Delete head
sql = """DELETE FROM heads
WHERE ixh IN (
--
conrad
More information about the cvs-annodex
mailing list