本文整理匯總了Python中prueba.model.DBSession.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python DBSession.delete方法的具體用法?Python DBSession.delete怎麽用?Python DBSession.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類prueba.model.DBSession
的用法示例。
在下文中一共展示了DBSession.delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: EliminarFase
# 需要導入模塊: from prueba.model import DBSession [as 別名]
# 或者: from prueba.model.DBSession import delete [as 別名]
def EliminarFase(self, proy_id, fase_id, **kw):
DBSession.delete(DBSession.query(Fase).get(fase_id))
#DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('ConsultarUsuario' + usuario_id)).one())
#DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EditarUsuario' + usuario_id)).one())
#DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EliminarUsuario' + usuario_id)).one())
#DBSession.delete(DBSession.query(Group).filter_by(group_name=('RolPorDefecto' + usuario_id)).one())
redirect("/DefinirFases/"+proy_id)
示例2: EliminarUsuario
# 需要導入模塊: from prueba.model import DBSession [as 別名]
# 或者: from prueba.model.DBSession import delete [as 別名]
def EliminarUsuario(self, usuario_id, **kw):
DBSession.delete(DBSession.query(User).get(usuario_id))
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('ConsultarUsuario' + usuario_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EditarUsuario' + usuario_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EliminarUsuario' + usuario_id)).one())
DBSession.delete(DBSession.query(Group).filter_by(group_name=('RolPorDefecto' + usuario_id)).one())
redirect("/ListarUsuarios")
示例3: EliminarProyecto
# 需要導入模塊: from prueba.model import DBSession [as 別名]
# 或者: from prueba.model.DBSession import delete [as 別名]
def EliminarProyecto(self, proy_id, **kw):
proyecto = DBSession.query(Proyecto).get(proy_id)
fases = proyecto.fases
if not isinstance(fases, list):
fases = [fases]
for fase in fases:
DBSession.delete(fase)
DBSession.delete(DBSession.query(Proyecto).get(proy_id))
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('ConsultarProyecto' + proy_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EditarProyecto' + proy_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EliminarProyecto' + proy_id)).one())
redirect("/ListarProyectos/")
示例4: EliminarRol
# 需要導入模塊: from prueba.model import DBSession [as 別名]
# 或者: from prueba.model.DBSession import delete [as 別名]
def EliminarRol(self, rol_id, **kw):
DBSession.delete(DBSession.query(Group).get(rol_id))
#DBSession.query(Permission).filter_by(permission_name=('EditarRol' + rol_id)).one()
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('ConsultarRol' + rol_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EditarRol' + rol_id)).one())
DBSession.delete(DBSession.query(Permission).filter_by(permission_name=('EliminarRol' + rol_id)).one())
redirect("/ListarRoles")