本文整理汇总了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()
示例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")
示例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")
示例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')
示例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')
示例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')
示例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')
示例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)
示例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')