-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Clarify APIView.dispatch request lifecycle in docstring #9884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Clarify APIView.dispatch request lifecycle in docstring #9884
Conversation
| > — [Reinout van Rees][cite] | ||
|
|
||
| REST framework provides an `APIView` class, which subclasses Django's `View` class. | ||
| REST framework provides an `APIView` class, which subclasses Django’s base `View` class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "inherits" ?
| """ | ||
| `.dispatch()` is pretty much the same as Django's regular dispatch, | ||
| but with extra hooks for startup, finalize, and exception handling. | ||
| Dispatch the incoming request to the appropriate handler method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good, mentioning the flow is actually a good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's definitely an improvement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file were rejected in #9882 please don't submit them again
| """ | ||
| `.dispatch()` is pretty much the same as Django's regular dispatch, | ||
| but with extra hooks for startup, finalize, and exception handling. | ||
| Dispatch the incoming request to the appropriate handler method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's definitely an improvement
This PR improves the docstring for
APIView.dispatchto better documentthe request/response lifecycle in Django REST Framework.
The updated docstring explains:
No functional changes are introduced.