本文整理汇总了Python中point.core.user.User.get_info方法的典型用法代码示例。如果您正苦于以下问题:Python User.get_info方法的具体用法?Python User.get_info怎么用?Python User.get_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point.core.user.User
的用法示例。
在下文中一共展示了User.get_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_info
# 需要导入模块: from point.core.user import User [as 别名]
# 或者: from point.core.user.User import get_info [as 别名]
def get_info(self, param=None):
if self.id or self.info or self.info_upd:
return User.get_info(self, param)
if param:
return None
return {}
示例2: info
# 需要导入模块: from point.core.user import User [as 别名]
# 或者: from point.core.user.User import get_info [as 别名]
def info(user):
"""Get user info
"""
if isinstance(user, (str, unicode)):
user = User('login', user)
if env.user.id != user.id and user.get_profile('private') \
and not user.check_whitelist(env.user):
raise SubscribeError
return user.get_info()
示例3: avatar
# 需要导入模块: from point.core.user import User [as 别名]
# 或者: from point.core.user.User import get_info [as 别名]
def avatar(login, size):
"""To avoid code duplication, parameter ``login`` can be interpreted
as a number if it is user id, and as a string if it is user login"""
size = int(size) if size else 40
try:
if login and login.isdigit():
user = User(int(login))
else:
user = User('login', login)
avatar = user.get_info('avatar')
except UserNotFound:
avatar = None
if avatar:
path = '%s%s/%s/%s' % \
(env.request.protocol, settings.avatars_root, size, avatar)
else:
path = '%s%s/av%s.png' % \
(env.request.protocol, settings.avatars_root, size)
return Response(redirect=path)