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


Python Session.delete方法代码示例

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


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

示例1: applydefaults

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
def applydefaults():
    global defaults
    for key_name in defaults.keys():
        configrow = Session.query(Config).filter(Config.config_key == key_name).first()
        if configrow == None:
            setValue(key_name, defaults[key_name])
    # purge extraneous values
    for configrow in Session.query(Config):
        if not defaults.has_key(configrow.config_key):
            Session.delete(configrow)
    Session.flush()
开发者ID:gajop,项目名称:springgrid,代码行数:13,代码来源:confighelper.py

示例2: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.aiadmin):
            c.message = "You must be logged in as a aiadmin"
            return render("genericmessage.html")

        ai = Session.query(AI).filter(AI.ai_id == id).first()
        if ai == None:
            c.message = "No such ai"
            return render("genericmessage.html")

        Session.delete(ai)
        Session.commit()

        c.message = "Deleted ok"
        return render("genericmessage.html")
开发者ID:gajop,项目名称:springgrid,代码行数:17,代码来源:ai.py

示例3: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.modadmin):
            c.message = "You must be logged in as a modadmin"
            return render("genericmessage.html")

        mod = Session.query(Mod).filter(Mod.mod_id == id).first()
        if mod == None:
            c.message = "No such mod"
            return render("genericmessage.html")

        Session.delete(mod)
        Session.commit()

        c.message = "Deleted ok"
        return render("genericmessage.html")
开发者ID:gajop,项目名称:springgrid,代码行数:17,代码来源:mod.py

示例4: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.modadmin):
            c.message = "You must be logged in as a modadmin, temporary!"
            return render('genericmessage.html')

        engine = Session.query(Engine).filter(Engine.engine_id == id).first()
        if engine == None:
            c.message = "No such engine"
            return render('genericmessage.html')

        Session.delete(engine)
        Session.commit()

        c.message = "Deleted ok"
        return render('genericmessage.html')
开发者ID:gajop,项目名称:springgrid,代码行数:17,代码来源:engine.py

示例5: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.mapadmin):
            c.message = "You must be logged in as a mapadmin"
            return render('genericmessage.html')

        map = Session.query(Map).filter(Map.map_id == id).first()
        if map == None:
            c.message = "No such map"
            return render('genericmessage.html')

        Session.delete(map)
        Session.commit()

        c.message = "Deleted ok"
        return render('genericmessage.html')
开发者ID:gajop,项目名称:springgrid,代码行数:17,代码来源:map.py

示例6: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
 def remove(self, id):
     if not roles.isInRole(roles.leagueadmin):
         c.message = "You must be logged in as a leagueadmin"
         return render('genericmessage.html')
     
     request = Session.query(MatchRequest).filter(MatchRequest.matchrequest_id == id).first()
     
     if request == None:
         c.message = "No such request"
         return render('genericmessage.html')   
     
     Session.delete(request)
     Session.commit()
     
     c.message = "Deleted ok"
     return render('genericmessage.html')    
开发者ID:gajop,项目名称:springgrid,代码行数:18,代码来源:matches.py

示例7: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.leagueadmin):
            c.message = "You must be logged in as a leagueadmin"
            return render('genericmessage.html')

        league = Session.query(League).filter(League.league_id == id).first()
        if league == None:
            c.message = "No such league"
            return render('genericmessage.html')
        
        Session.query(LeagueAI).filter(LeagueAI.league_id == id).delete()
        Session.delete(league)
        Session.commit()

        c.message = "Deleted ok"
        return render('genericmessage.html')
开发者ID:gajop,项目名称:springgrid,代码行数:18,代码来源:league.py

示例8: expireBotRunnerSession

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
def expireBotRunnerSession(botrunner, session):
    # first, remove any matchrequests in progress attached to this session
    requestsinprogress = (
        Session.query(MatchRequest)
        .filter(MatchRequest.matchresult == None)
        .filter(MatchRequest.matchrequestinprogress != None)
    )
    for request in requestsinprogress:
        if (
            request.matchrequestinprogress.botrunner == botrunner
            and request.matchrequestinprogress.botrunnersession == session
        ):
            Session.delete(request.matchrequestinprogress)
    Session.delete(session)

    # then, delete session
    Session.delete(session)
开发者ID:gajop,项目名称:springgrid,代码行数:19,代码来源:botrunnerhelper.py

示例9: remove

# 需要导入模块: from springgrid.lib.base import Session [as 别名]
# 或者: from springgrid.lib.base.Session import delete [as 别名]
    def remove(self, id):
        if not roles.isInRole(roles.accountadmin):
            c.message = "You must be logged in as a accountadmin"
            return render('genericmessage.html')

        account = Session.query(Account).filter(
                Account.account_id == id).first()
        if account == None:
            c.message = "No such account"
            return render('genericmessage.html')

        if roles.isInRole2(account.username, roles.accountadmin):
            c.message = "Please drop the accountadmin role from "
            return render('genericmessage.html')

        if account.passwordinfo != None:
            Session.delete(account.passwordinfo)
        for openid in account.openids:
            Session.delete(openid)
        Session.delete(account)
        Session.commit()

        c.message = "Deleted ok"
        return render('genericmessage.html')
开发者ID:gajop,项目名称:springgrid,代码行数:26,代码来源:account.py


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