当前位置: 首页>>代码示例>>Python>>正文


Python DBApiModule.deleteFromTable方法代码示例

本文整理汇总了Python中app.db.DBApiModule.deleteFromTable方法的典型用法代码示例。如果您正苦于以下问题:Python DBApiModule.deleteFromTable方法的具体用法?Python DBApiModule.deleteFromTable怎么用?Python DBApiModule.deleteFromTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.db.DBApiModule的用法示例。


在下文中一共展示了DBApiModule.deleteFromTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testDropPWByUser

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropPWByUser(self):
     self.insertUser(self.id, self.name, self.email)
     self.insertPW(self.pw.userId, self.pw.value, self.pw.salt)
     
     db.deleteFromTable(self.conn, "user", id=self.id) 
     row = db.selectFrom(self.conn, {"pw_hash"}, "*", user_id=self.id)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:9,代码来源:User.py

示例2: testDropTagByUser

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropTagByUser(self):
     self.insertUser(self.id, self.name, self.email)
     self.insertTag(self.tag.id, self.tag.name)
     
     db.deleteFromTable(self.conn, "user", id=self.id)
     row = db.selectFrom(self.conn, {"tag"}, "*" , id=self.tag.id)
     # FIXME: when a user is deleted all of his tags must be removed 
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:10,代码来源:User.py

示例3: testDropGroupByUser

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropGroupByUser(self):
     self.insertUser(self.id, self.name, self.email)
     self.insertGroup(self.group.id, self.group.name, self.group.public)
     
     db.deleteFromTable(self.conn, "user", id=self.id)
     row = db.selectFrom(self.conn, {"link_group"}, "*" , id=self.group.id)
     # FIXME: when a user is deleted all of his groups must be removed
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:10,代码来源:User.py

示例4: testDropMetaDataByLink

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropMetaDataByLink(self):
     self.insertLink(self.id, self.userId, self.url, self.urlHash, self.title,
                     self.desc, self.typeName , self.modifiedAt)
     self.insertMetaData(self.metaData.linkId, self.metaData.key, self.metaData.value)
     
     db.deleteFromTable(self.conn, "link", id=self.id)
     row = db.selectFrom(self.conn, {"meta_data"}, "*", link_id=self.metaData.linkId)
     self.assertEqual(row, []) 
开发者ID:lutzer,项目名称:sahabe,代码行数:10,代码来源:Link.py

示例5: testDropLinkTagMapByLink

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLinkTagMapByLink(self):
     self.insertLink(self.id, self.userId, self.url, self.urlHash, self.title,
                     self.desc, self.typeName , self.modifiedAt)
     self.insertTag(self.tag.id, self.tag.name)
     self.insertLinkTagMap(self.linkTagMap.tagId, self.linkTagMap.linkId)
     
     db.deleteFromTable(self.conn, "link", id=self.id)
     row = db.selectFrom(self.conn, {"link_tag_map"}, "*", link_id=self.linkTagMap.linkId)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:11,代码来源:Link.py

示例6: testDropLinkGroupMapByLink

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLinkGroupMapByLink(self):
     self.insertLink(self.id, self.userId, self.url, self.urlHash, self.title,
                     self.desc, self.typeName , self.modifiedAt)
     self.insertGroup(self.group.id, self.group.name, self.group.public)
     self.insertLinkGroupMap(self.linkGroupMap.groupId, self.linkGroupMap.linkId)
     
     db.deleteFromTable(self.conn, "link", id=self.id)
     row = db.selectFrom(self.conn, {"link_group_map"}, "*", link_id=self.linkGroupMap.linkId)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:11,代码来源:Link.py

示例7: testDropLinkGroupMapByGroup

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLinkGroupMapByGroup(self):
     self.insertUser(self.user.id, self.user.name, self.user.email)
     self.insertLink(self.link.id, self.link.userId, self.link.url, self.link.urlHash, self.link.title,
                     self.link.description, self.link.typeName , self.link.modifiedAt)
     self.insertGroup(self.id, self.name, self.public)
     self.insertLinkGroupMap(self.linkGroupMap.groupId, self.linkGroupMap.linkId)
     
     db.deleteFromTable(self.conn, "link_group", id=self.id)
     row = db.selectFrom(self.conn, {"link_group_map"}, "*", group_id=self.id)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:12,代码来源:Group.py

示例8: testDropLinkTagMapByTag

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLinkTagMapByTag(self):
     self.insertUser(self.user.id, self.user.name, self.user.email)
     self.insertLink(self.link.id, self.link.userId, self.link.url, self.link.urlHash, self.link.title,
                     self.link.description, self.link.typeName , self.link.modifiedAt)
     self.insertTag(self.id, self.name)
     self.insertLinkTagMap(self.linkTagMap.tagId, self.linkTagMap.linkId)
     
     db.deleteFromTable(self.conn, "tag", id=self.id)
     row = db.selectFrom(self.conn, {"link_tag_map"}, "*", tag_id=self.id)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:12,代码来源:Tag.py

示例9: testDropSearchTableByLink

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropSearchTableByLink(self):
     self.insertLink(self.id, self.userId, self.url, self.urlHash, self.title,
                     self.desc, self.typeName , self.modifiedAt)
     self.insertSearchTable(self.searchTable.userId,
                            self.searchTable.linkId,
                            self.searchTable.groups,
                            self.searchTable.tags,
                            self.searchTable.text)
     db.deleteFromTable(self.conn, "link", id=self.id)
     row = db.selectFrom(self.conn, {"search_table"}, "*" , link_id=self.searchTable.linkId)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:13,代码来源:Link.py

示例10: testDropLinkByUser

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLinkByUser(self):
     self.insertUser(self.id, self.name, self.email)
     self.insertLink(self.link.id,
                     self.link.userId,
                     self.link.url,
                     self.link.urlHash,
                     self.link.title,
                     self.link.description,
                     self.link.typeName,
                     self.link.modifiedAt)
     
     db.deleteFromTable(self.conn, "user", id=self.id) 
     row = db.selectFrom(self.conn, {"link"}, "*", id=self.link.id)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:16,代码来源:User.py

示例11: testLinkGroupMap

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testLinkGroupMap(self):
     self.insertLinkGroupMap(self.groupId, self.linkId)
     db.deleteFromTable(self.conn, "link_group_map", group_id=self.groupId)
     rows = db.selectFrom(self.conn, {"link_group_map"}, "*", group_id=self.groupId)
     self.assertEquals(rows, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:7,代码来源:LinkGroupMap.py

示例12: testDropLink

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropLink(self):
     self.insertLink(self.id, self.userId, self.url, self.link.urlHash, self.title,
                     self.desc, self.typeName , self.modifiedAt)
     db.deleteFromTable(self.conn, "link", id=self.id) 
     row = db.selectFrom(self.conn, {"link"}, "*", id=self.id)
     self.assertEqual(row, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:8,代码来源:Link.py

示例13: testPW

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testPW(self):
     self.insertPW(self.userId, self.value, self.salt)
     db.deleteFromTable(self.conn, "pw_hash", user_id=self.userId)
     rows = db.selectFrom(self.conn, {"pw_hash"}, "*", user_id=self.userId)
     self.assertEquals(rows, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:7,代码来源:PassWord.py

示例14: testLinkTagMap

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testLinkTagMap(self):
     self.insertLinkTagMap(self.tagId, self.linkId)
     db.deleteFromTable(self.conn, "link_tag_map", tag_id=self.tagId)
     rows = db.selectFrom(self.conn, {"link_tag_map"}, "*", tag_id=self.tagId)
     self.assertEquals(rows, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:7,代码来源:LinkTagMap.py

示例15: testDropGroup

# 需要导入模块: from app.db import DBApiModule [as 别名]
# 或者: from app.db.DBApiModule import deleteFromTable [as 别名]
 def testDropGroup(self):
     self.insertGroup(self.id, self.name, self.public)
     db.deleteFromTable(self.conn, "link_group", id=self.id)
     rows = db.selectFrom(self.conn, {"link_group"}, "*", id=self.id)
     self.assertEquals(rows, [])
开发者ID:lutzer,项目名称:sahabe,代码行数:7,代码来源:Group.py


注:本文中的app.db.DBApiModule.deleteFromTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。