本文整理汇总了Python中user.User.create_resource方法的典型用法代码示例。如果您正苦于以下问题:Python User.create_resource方法的具体用法?Python User.create_resource怎么用?Python User.create_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user.User
的用法示例。
在下文中一共展示了User.create_resource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: user
# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_resource [as 别名]
def user(id):
response = None
if request.method == 'POST':
response = User.create_resource(eval(request.data))
elif request.method == 'PATCH':
response = User.update_resource(eval(request.data), id)
elif request.method == 'DELETE':
response = User.set_resource_inactive(id)
elif request.method == 'GET':
response = User.get_resource_or_collection(request.args, id)
return response
示例2: user
# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_resource [as 别名]
def user(id):
"""Methods directly Related to the user resource"""
response = None
if request.method == 'POST':
response = User.create_resource(eval(request.data))
elif request.method == 'PATCH':
response = User.update_resource(eval(request.data), id)
elif request.method == 'DELETE':
response = User.deactivate_resource(id)
elif request.method == 'GET' and id:
response = User.get_resource(request.args, id)
elif request.method == 'GET':
response = User.get_collection(request.args)
return response
示例3: post_user
# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_resource [as 别名]
def post_user():
return User.create_resource(eval(request.data))