本文整理汇总了Python中database.DataBase.delete方法的典型用法代码示例。如果您正苦于以下问题:Python DataBase.delete方法的具体用法?Python DataBase.delete怎么用?Python DataBase.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.DataBase
的用法示例。
在下文中一共展示了DataBase.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _delete_row_cb
# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import delete [as 别名]
def _delete_row_cb(self, widget, data=None):
'''Delete a row'''
selection = self.tasks_list.get_selection()
model, row_iter = selection.get_selected()
row = model[row_iter]
data = (row[0],)
db = DataBase(self.path)
db.delete(data)
db.close()
self.get_tasks()
示例2: __delete_user
# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import delete [as 别名]
def __delete_user(self, unused):
self.__generalize_status_bar()
database = DataBase()
edit_list = [contacts for contacts in self.__contact_box if
contacts.get_child().get_children()[0].get_active()]
if not edit_list:
self.__push_status_message('<span font_desc="belgrano 10"> Select at least <b><span foreground="#FF0000">one</span></b> contact</span>')
return False
contacts = [contact.get_contact_info()[1] for contact in edit_list]
for number in contacts:
database.delete('contacts', number)
database.close()
self.add_contacts()
return False