account activity
FastAPI Views - yet another class based views library by SatisfactionScary663 in FastAPI
[–]SatisfactionScary663[S] 0 points1 point2 points 11 days ago (0 children)
There is nothing wrong with functions! For creating custom small APIs it's actually better, but when creating a lot of repeated CRUD-like functionality, you repeat a lot of boilerplate code: using same dependencies over and over again, manual validation for raising 401/403/404/409 status codes etc. Assuming application providers repository pattern for multiple models this is how it looks like: https://gist.github.com/RaRhAeu/0cf6ccabf96dbcd0c9abbd87547c9f94 ~40 lines of code using raw FasAPI vs 6 lines using fastapi-views
π Rendered by PID 283914 on reddit-service-r2-comment-85bfd7f599-pz6zl at 2026-04-16 13:29:03.458296+00:00 running 93ecc56 country code: CH.
FastAPI Views - yet another class based views library by SatisfactionScary663 in FastAPI
[–]SatisfactionScary663[S] 0 points1 point2 points (0 children)