tutorial
tutorial copied to clipboard
Tutorial skips a step. Is it intentional?
When defining post_detail
view in extend your application, tutorial skips a step:
After saying
Now, we want to get one and only one blog post. To do this we can use querysets like this:
Post.objects.get(pk=pk)
it immediately jumps to
But this code has a problem. If there is no Post with given primary key (pk) we will have a super ugly error!
Shouldn't there be an intermediate step? Explaining what's in the view, or that they need to test the code by going to browser with a non-existent pk
? Or is it intentional and expected that they know how to do this without any help at this point?
I believe the ORM is explained in chapter 10 where the objects.get
method is explained. The view contents are explained earlier in this step. I'm not sure what should we do with this. Can you @zanderle explain in more detail what is missing in that chapter?
I might be mistaken, but the view contents are not explained earlier in this step. It's only mentioned that we need to create a view. To be clear, I am talking about the post_detail_view part of the chapter. And this part jumps right into the code. There's no mention of render, so if they just put Post.objects.get(pk=pk)
in their view, they would not see the error that is shown in the screenshot.
So nothing is missing in this step, but the order is somewhat confusing. I believe it would be better to first show the view and only afterwards explain the problem of using Post.objects.get(pk=pk)
(as at this point, they can test themselves the error that the tutorial is showing them).
@aniav I hope this make it clearer?
Yes, this is clear now. Thank you! :)
@zanderle and @aniav: Can you check if this issue still needs to be fixed? Thanks :sparkles:
@patjouk yeah, this hasn't been changed yet as far as I can tell
Confirmed this is still an issue.