Update docs/tutorial/6-viewsets-and-routers.md

This commit is contained in:
Asif Saif Uddin 2022-11-22 12:28:14 +06:00 committed by GitHub
parent 197f83f762
commit 63510957a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,6 +130,6 @@ The `DefaultRouter` class we're using also automatically creates the API root vi
## Trade-offs between views vs ViewSets
Using view sets can be a really useful abstraction. It helps ensure that URL conventions will be consistent across your API, minimizes the amount of code you need to write, and allows you to concentrate on the interactions and representations your API provides rather than the specifics of the URL conf.
Using ViewSets can be a really useful abstraction. It helps ensure that URL conventions will be consistent across your API, minimizes the amount of code you need to write, and allows you to concentrate on the interactions and representations your API provides rather than the specifics of the URL conf.
That doesn't mean it's always the right approach to take. There's a similar set of trade-offs to consider as when using class-based views instead of function-based views. Using ViewSets is less explicit than building your API views individually.