Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Has litestar CBV (class based views) fastapi refuses to implement them so we build [1]. Or proper lifetime event [2]?

[1] https://github.com/KiraPC/fastapi-router-controller [2] https://github.com/tiangolo/fastapi/issues/617



Yes litestar have class based controllers since day one , class based views with HTMX/Jinja is also available in 2.0 which is now nearing release. Here is lifecycle management : https://docs.litestar.dev/2/usage/the-litestar-app.html#star...

  app = Litestar(on_startup=[get_db_connection], on_shutdown=[close_db_connection])
We have quite powerful channels and event systems that goes along with websocket and realtime systems too.

Plus , if you use Repository + Sqlalchmey Plugin and DTO , you can also work with CRUD events before_update/after_update/before_insert/after_instet etc


just looked into the docs [1] and indeed it has CBV ... I will definitely take a closer look.

[1] https://docs.litestar.dev/latest/#feature-comparison-with-si...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: