Reputation: 1214
I can create my view in Django with :
Now is there any standard to tell us when should we use which?
and why we have this much type at all?
Upvotes: 4
Views: 659
Reputation: 4151
There is no standard but you can start with this simple strategy:
RetrieveAPIView
,
ListAPIView
, UpdateAPIView
, etc.)ModelViewSet
and ReadOnlyModelViewSet
are most useful)@action(detail=True)
@action(detail=False)
@action
again.Also check DRF views classes for quick overview.
Upvotes: 6