Baloneo 最近的时间轴更新
Baloneo

Baloneo

V2EX 第 550845 号会员,加入于 2021-07-14 16:15:14 +08:00
根据 Baloneo 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
Baloneo 最近回复了
3 天前
回复了 changnet 创建的主题 生活 什么世道,自行车被偷了
广州头盔 打气筒 雨衣都经常有人偷
16 天前
回复了 Baloneo 创建的主题 Linux 有没有 Linux 下的游戏手柄推荐
@coderluan
@onikage
@xgfan 好的 买个试试
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
@fakeshadow 比 fastapi 还是快很多
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
@Oxonomy 或许可以将更多的模块用 rust python 绑定重写 用 python 调用
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
@fakeshadow 确实是错了 估计是 Robyn 框架并发的 bug
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
@vicalloy 已经是 orjson 了
22 天前
回复了 Baloneo 创建的主题 Python Rust 给 Python Web 带来的性能提升
@rrfeng 是的
23 天前
回复了 XueXianqi 创建的主题 Python Flask 如何验证前端传过来的数据
```
def validate_schema(schema_class):
assert issubclass(schema_class, Schema) # Marshmallow

def decorator(view_func):
@functools.wraps(view_func)
def inner(*args, **kwargs):

if request.method == "GET":
form_data = request.args
else:
form_data = request.json
try:
data = schema_class().load(form_data)
_request_ctx_stack.top.schema_data = data
except ValidationError as e:
return error_json(
ResponseCode.ERROR, parse_err_messages(e), data=e.messages
)
return view_func(*args, **kwargs)

return inner

return decorator

@validate_schema(val.PostTestSchema)
def api_test():
device_id = current_schema_data.get('device_id')
```
Python +1
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   766 人在线   最高记录 6067   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 20:15 · PVG 04:15 · LAX 13:15 · JFK 16:15
Developed with CodeLauncher
♥ Do have faith in what you're doing.