3 ms·
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-ro
by delijati 3y ago
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 https://github.com/KiraPC/fastapi-router-controller
[2] https://github.com/tiangolo/fastapi/issues/617 https://github.com/tiangolo/fastapi/issues/617
- delijati 3y agojust 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-similar-frameworks https://docs.litestar.dev/latest/#feature-comparison-with-si...
- v3ss0n 3y agoYes 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#startup-and-shutdown 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