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

This commit is contained in:
Asif Saif Uddin 2022-11-22 12:27:26 +06:00 committed by GitHub
parent f7a071e54c
commit 3190a0dad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ Registering the ViewSets with the router is similar to providing a urlpattern.
The `DefaultRouter` class we're using also automatically creates the API root view for us, so we can now delete the `api_root` function from our `views` module. The `DefaultRouter` class we're using also automatically creates the API root view for us, so we can now delete the `api_root` function from our `views` module.
## Trade-offs between views vs view sets ## 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 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.