Django views — improve the intro paragraph #1862
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I made the intro to the chapter more precise, more clear and more technical.
I split what the view does in 3 clear steps. Each step contains one highlighted technical word (
request
,model
,template
) which makes it easier to understand which technical thing is responsible for what. The first step acknowledges that the views receiverequest
data as a parameter. The previous version wasn't explicit about it but I think it is important because therequest
is a parameter of a function we are about to write. I added an example of what does "logic" mean in the context of "views are where we put the logic of our application" to the second step. The third step is about filling atemplate
. I think "filling a template" is better wording than "passing it to a template".I rewrote the words "just Python functions that are a little bit more complicated than the ones we wrote" to "Technically, views are Python functions, exactly like the ones we wrote in the Introduction to Python chapter. These functions take
request
as a parameter and returnHttpResponse
". The new wording avoids the word "just" and instead of being vague tells what the difference is between the old functions and the new ones. The resulting paragraph sounds quite technical but I think it comes together nicely with the explanation of the code. The participants will see therequest
in the parameters and their recognition will click because they read about it earlier.