3 ms·
As mentioned elsewhere in this thread, simple CRUD usually stops being simple CRUD pretty quickly. If you are actually doing simple CRUD, then DRF's ModelViewS
by WD-42 3y ago
As mentioned elsewhere in this thread, simple CRUD usually stops being simple CRUD pretty quickly.
If you are actually doing simple CRUD, then DRF's ModelViewSets are great, and Pydantic would indeed be an overkill. However once the view diverges from your DB model, writing Pydantic models IMO is FAR superior than having to write custom DRF serializers.
- bb88 3y agoThe key there is 'IMO' isn't it? If the DB is your schema, great, DRF is awesome. But if the DB is not your schema, no problem, DRF still can handle it. And with DRF you get CRUD by default. And if you don't want CRUD, no problem, DRF has generic API views too.
- WD-42 3y agoSo exactly like this package and ninja? Except instead of writing un typed drf serializers you get to write small, concise pydantic models.