本文整理匯總了Python中Action.Action.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python Action.delete方法的具體用法?Python Action.delete怎麽用?Python Action.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Action.Action
的用法示例。
在下文中一共展示了Action.delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Role
# 需要導入模塊: from Action import Action [as 別名]
# 或者: from Action.Action import delete [as 別名]
'action':relation(Action, backref='roleaction'),
}, order_by=t_roleaction.c.id_role)
idAdmin = Role().select(name ="Admin")
if not idAdmin:
print "ATTENZIONE NON e' PRESENTE UN ADMIN"
else:
idadmin = idAdmin[0].id
idact = params["session"].query(Action.id).all()
idract = params["session"].query(RoleAction.id_action).filter_by(id_role=idadmin).all()
if idact != idract:
ac = Action().select(batchSize=None)
for a in ac:
ra = RoleAction().select(id_role=idadmin,id_action=a.id, batchSize=None)
if not ra:
aa = RoleAction()
aa.id_role = idadmin
aa.id_action = a.id
session.add(aa)
params["session"].commit()
#SERVER per eliminare una riga inutile ...ricordati di usare gli id
aa = RoleAction().select(id_action=5, batchSize=None)
if aa:
for a in aa:
a.delete()
a = Action().getRecord(id=5)
if a:
if a.denominazione_breve =="INSERIMENTO":
a.delete()