本文整理汇总了Python中models.UserInfo.get_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python UserInfo.get_by_id方法的具体用法?Python UserInfo.get_by_id怎么用?Python UserInfo.get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.UserInfo
的用法示例。
在下文中一共展示了UserInfo.get_by_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: credentials_valid_and_user_registered
# 需要导入模块: from models import UserInfo [as 别名]
# 或者: from models.UserInfo import get_by_id [as 别名]
def credentials_valid_and_user_registered(email, password):
"""
Only returns true if the email exists in the datastore,
and the password is correct.
"""
#TODO(rushiagr): put all the server-side validation code here
user = UserInfo.get_by_id(email)
if user is not None and user.password == password:
return True
return False
示例2: email_already_in_db
# 需要导入模块: from models import UserInfo [as 别名]
# 或者: from models.UserInfo import get_by_id [as 别名]
def email_already_in_db(email):
user = UserInfo.get_by_id(email)
if user is not None:
return True
return False
示例3: mys_on
# 需要导入模块: from models import UserInfo [as 别名]
# 或者: from models.UserInfo import get_by_id [as 别名]
def mys_on(user):
ui = UserInfo.get_by_id(str(user.user_id()))
if ui.mys == False:
ui.mys = True
ui.put()
示例4: mys_off
# 需要导入模块: from models import UserInfo [as 别名]
# 或者: from models.UserInfo import get_by_id [as 别名]
def mys_off(user):
ui = UserInfo.get_by_id(str(user.user_id()))
if ui.mys == True:
ui.mys = False
ui.put()
return 'was_true'