mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-24 23:19:47 +03:00
Update docs/tutorial/6-viewsets-and-routers.md
This commit is contained in:
parent
197f83f762
commit
63510957a6
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user