本文整理汇总了Python中app.users.models.User.fromNode方法的典型用法代码示例。如果您正苦于以下问题:Python User.fromNode方法的具体用法?Python User.fromNode怎么用?Python User.fromNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.users.models.User
的用法示例。
在下文中一共展示了User.fromNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from app.users.models import User [as 别名]
# 或者: from app.users.models.User import fromNode [as 别名]
def get():
args = ['username']
result = ''
try:
for i in args:
assert i in request.args, 'missing ' + i
l = list(graph_db.find("User","username",request.args['username']))
if len(l) == 1: result = str(User.fromNode(l[0]))
else: result = "user not found"
except AssertionError, e:
result = str(e)
示例2: getUserByUsername
# 需要导入模块: from app.users.models import User [as 别名]
# 或者: from app.users.models.User import fromNode [as 别名]
def getUserByUsername(username):
l = list(graph_db.find("User","username",username))
if len(l) == 1: return User.fromNode(l[0])
else: return None
示例3: getUserByID
# 需要导入模块: from app.users.models import User [as 别名]
# 或者: from app.users.models.User import fromNode [as 别名]
def getUserByID(userid):
l = list(graph_db.find("User","userid",userid))
if len(l) == 1: return User.fromNode(l[0])
else: return None