def updateAuthority(self, authorityId, text, menuIdList): DBConn().begin(); try: DBAuthority.deleteByAuthorityId(authorityId) DBAuthority.insrt(text, authorityId, menuIdList) DBConn().commit(); except Exception, e: print e DBConn().rollback();
def createAuthority(self, text): value = DBAuthority.insrt(text) return value