本文整理汇总了Python中models.Game.selectOne方法的典型用法代码示例。如果您正苦于以下问题:Python Game.selectOne方法的具体用法?Python Game.selectOne怎么用?Python Game.selectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Game
的用法示例。
在下文中一共展示了Game.selectOne方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import selectOne [as 别名]
def post(self):
game = Game()
#Check logged in
user = users.get_current_user()
if not user:
self.response.write(json.dumps(dict(error="Dude, you gotta be logged in! Try reloading this page.")))
return
this_player = game.selectOne(config.JIVE_PROFILE_TBL, "fullname, title, picture_binary, id", "`email` = {}", [user.email()])
if this_player is None:
logging.info("couldn't find player in jive_profile table (email: '{0}')".format(email))
self.response.write(json.dumps({"result":"refresh"}))
return
#Get the json passed from the client page
jsonstring = self.request.body
jsdict = json.loads(jsonstring)
if 'filterchange' not in jsdict:
ret = self.choice_picked(game, this_player, jsdict)
else:
ret = self.new_filter(game, this_player, jsdict)
self.response.write(json.dumps(ret))
示例2: get_total_player_count
# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import selectOne [as 别名]
def get_total_player_count():
"""Get cached total player count"""
total_players = memcache.get(PLAYER_COUNT)
if total_players is None:
#Force regeneration of all players and their keys
game = Game()
player = game.selectOne(config.MEDIFACES_PLAYER_TBL, "COUNT(*)", "bad_avatar = 0")
total_player = player[0]
logging.info('Total players: {0}'.format(total_player))
return total_player
示例3: get
# 需要导入模块: from models import Game [as 别名]
# 或者: from models.Game import selectOne [as 别名]
def get(self):
user = users.get_current_user()
#If not a Medidata email account
if not isMedidata(user.email()):
self.redirect('/medidataonly')
return
game = Game()
player = game.selectOne(config.JIVE_PROFILE_TBL, "id", "`email` = {}", [user.email()])
#if this player is in jive_profile
if player:
self.redirect('/')
return
template = JINJA_ENVIRONMENT.get_template('needprofilepicture.html')
self.response.write(template.render())