V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wuwukai007
V2EX  ›  Python

django 4.1 异步 ORM,异步视图类来了!

  •  
  •   wuwukai007 · 2022-05-21 13:17:17 +08:00 · 4016 次点击
    这是一个创建于 677 天前的主题,其中的信息可能已经有所发展或是发生改变。
    10 条回复    2022-05-23 21:24:46 +08:00
    youngce
        1
    youngce  
       2022-05-21 13:19:40 +08:00
    666666
    233373
        2
    233373  
       2022-05-21 13:20:21 +08:00
    记得最后一次用还是 2.x 的版本,这都 4.x 了
    wangkun025
        3
    wangkun025  
       2022-05-21 13:22:41 +08:00
    图片用了 IP 地址耶。
    lanlanye
        4
    lanlanye  
       2022-05-21 21:21:36 +08:00
    好东西,不过已经切换到 FastAPI 了,感觉 SQLAlchemy 的异步支持很糟糕……不知道 Django ORM 处理得怎么样。

    最近在看 Rails ,突然觉得 Django 离人家的易用性还差好多……
    dcoder
        5
    dcoder  
       2022-05-22 04:56:28 +08:00
    @lanlanye
    FastAPI 的作者搞了个 SQLModel, wrapping over SQLAlchemy
    不过这个项目还很新, 异步文档都还没有
    https://sqlmodel.tiangolo.com/advanced/?h=async
    chuanqirenwu
        6
    chuanqirenwu  
       2022-05-22 23:25:44 +08:00
    目前还只是基于线程池的实现,等 native 的实现吧,不然感觉性能损失不少。
    Aloento
        7
    Aloento  
       2022-05-23 02:58:56 +08:00   ❤️ 2
    看了其他语言的实现,才真正发现 .NET 的好
    volvo007
        8
    volvo007  
       2022-05-23 11:01:18 +08:00
    一开始 fastapi 用是 https://tortoise-orm.readthedocs.io/en/latest/examples/fastapi.html 这个 orm, 后面不知道为啥又换成 sqlalchemy 了
    LeeReamond
        9
    LeeReamond  
       2022-05-23 16:51:00 +08:00
    @Aloento .net 吹哪都有,就是没人用
    Aloento
        10
    Aloento  
       2022-05-23 21:24:46 +08:00
    @LeeReamond 确实,悲
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1002 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:05 · PVG 06:05 · LAX 15:05 · JFK 18:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.