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


Python DBSession.delete方法代码示例

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


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

示例1: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self,user):
     recurso = DBSession.query(Recurso).filter(user.id_fase == Recurso.id_fase)
     DBSession.delete(recurso)
     transaction.commit()
     
     DBSession.delete(user)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:9,代码来源:FaseMan.py

示例2: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self,per):
     """
 Elimina un permiso de la base de datos
 @param per: el permiso que se quiere eliminar
 @return: none
 """
     DBSession.delete(per)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:10,代码来源:PermisoMan.py

示例3: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def deleteById(self, id):
     recurso = DBSession.query(Recurso).filter(id == Recurso.id_proyecto).one()
     DBSession.delete(recurso)
     transaction.commit()
     
     u = self.getById(id)
     DBSession.delete(u)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:10,代码来源:ProyectoMan.py

示例4: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self,lb):
     """
 Elimina una linea base de la base de datos
 @param lb: el objeto linea base que se quiere eliminar de la base de datos
 @return: none
 """
     DBSession.delete(lb)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:10,代码来源:LineaBaseMan.py

示例5: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def deleteById(self, id):
     """
 Elimina un permiso de la base de datos
 @param id: el identificador del permiso que se quiere eliminar
 @return: none
 """
     u = self.getById(id)
     DBSession.delete(u)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:11,代码来源:PermisoMan.py

示例6: quitarRol

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def quitarRol (self, id_rol, id_user, id_proyecto):
     print ("Quitar Rol -> id_rol: " + str(id_rol) + "id_usuario: " + str(id_user) + " id_proyecto: "+str(id_proyecto))
     r = self.getByRolUsuarioProyecto(id_rol, id_user, id_proyecto)
     for i in r.permisos_recursos:
         transaction.begin()
         DBSession.delete(i)
         transaction.commit()
     transaction.begin()
     DBSession.delete(r)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:12,代码来源:RolMan.py

示例7: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def deleteById(self, id1, id2, tipo):
     '''Elimina una relacion de la base de datos mediante
     su clave primaria
     @param: id_item1
     @param: id_item2
     @param: tipo de relacion
     '''
     u = self.getById(id1, id2, tipo)
     DBSession.delete(u)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:12,代码来源:RelacionMan.py

示例8: quitarRol

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def quitarRol(self, r):
     transaction.begin()
     permisos_recursos = DBSession.query(RolUsuario).filter(RolUsuario.id_rol_usuario==r.id_rol_usuario).one().permisos_recursos
    
     
     for i in permisos_recursos:
         DBSession.delete(i)
     transaction.commit()
     
     transaction.begin()
     DBSession.delete(r)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:14,代码来源:UsuarioMan.py

示例9: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
    def deleteById(self, id):
        ''' Elimina un Proyecto de la base de datos
        @param: id del proyecto'''
        roles = DBSession.query(RolUsuario).filter(RolUsuario.id_proyecto==id)
        if roles.count()>0:
            return False
        transaction.begin()
        u = self.getById(id)
        if u.fases != []:
            for i in u.fases:
                transaction.begin()
                recurso = DBSession.query(Recurso).filter(Recurso.id_fase==i.id_fase).one()
                DBSession.delete(recurso)
                transaction.commit()
                transaction.begin()
                fase = DBSession.query(Fase).filter(Fase.id_fase==i.id_fase).one()
                DBSession.delete(fase)
                transaction.commit()
        transaction.begin()
        recurso = DBSession.query(Recurso).filter(id == Recurso.id_proyecto).one()
        DBSession.delete(recurso)
        transaction.commit()
        transaction.begin()
        u = self.getById(id)

        DBSession.delete(u)
        transaction.commit()
        transaction.commit()
        return True
开发者ID:vanecan,项目名称:SGP14,代码行数:31,代码来源:ProyectoMan.py

示例10: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def deleteById(self, id):     
     proyectos = ProyectoManager().getByAdministrador(id)
     sin_administrador = self.getByLogin('sin administrador')
     '''Desasignar si es Administrador de Proyecto'''
     for proyecto in proyectos: 
         transaction.begin()
         proyecto.id_administrador = sin_administrador.id_usuario
         ProyectoManager().update(proyecto)
         transaction.commit()
         
     '''Quitar los roles''' 
     u=self.getById(id)
     for rolUsuario in u.roles:
         transaction.begin()
         self.quitarRol(rolUsuario)
         transaction.commit()
         
     '''Borrar Usuario'''
     transaction.begin()
     u=self.getById(id)
     DBSession.delete(u)
     transaction.commit()
     
     return True
开发者ID:vanecan,项目名称:SGP14,代码行数:26,代码来源:UsuarioMan.py

示例11: deleteById

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def deleteById(self, id):
     u = self.getById(id)
     DBSession.delete(u)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:6,代码来源:RolMan.py

示例12: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self,rol):
     DBSession.delete(rol)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:5,代码来源:RolMan.py

示例13: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self,adjunto):
     DBSession.delete(adjunto)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:5,代码来源:AdjuntoMan.py

示例14: delete

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete(self, relacion):
     ''' Elimina una relacion de la base de datos
     @param: Objeto relacion'''
     DBSession.delete(relacion)
     transaction.commit()
开发者ID:vanecan,项目名称:SGP14,代码行数:7,代码来源:RelacionMan.py

示例15: delete_recurso

# 需要导入模块: from sgp.model import DBSession [as 别名]
# 或者: from sgp.model.DBSession import delete [as 别名]
 def delete_recurso(self,user):
     recurso = DBSession.query(Recurso).filter(user.id_proyecto == Recurso.id_proyecto)
     DBSession.delete(recurso)
     transaction.commit()
开发者ID:javierpf,项目名称:SGP,代码行数:6,代码来源:ProyectoMan.py


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