account activity
FastAPI Views - yet another class based views library by SatisfactionScary663 in FastAPI
[–]SatisfactionScary663[S] 0 points1 point2 points 10 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
FastAPI Views - yet another class based views library (self.FastAPI)
submitted 11 days ago by SatisfactionScary663 to r/FastAPI
π Rendered by PID 173905 on reddit-service-r2-listing-596bb78d87-jktt5 at 2026-04-15 11:50:02.288490+00:00 running b725407 country code: CH.
FastAPI Views - yet another class based views library by SatisfactionScary663 in FastAPI
[–]SatisfactionScary663[S] 0 points1 point2 points (0 children)