tutorial icon indicating copy to clipboard operation
tutorial copied to clipboard

Tutorial skips a step. Is it intentional?

Open zanderle opened this issue 10 years ago • 6 comments

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?

zanderle avatar Oct 28 '14 17:10 zanderle

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?

aniav avatar Feb 11 '15 23:02 aniav

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?

zanderle avatar Feb 11 '15 23:02 zanderle

Yes, this is clear now. Thank you! :)

aniav avatar Feb 12 '15 11:02 aniav

@zanderle and @aniav: Can you check if this issue still needs to be fixed? Thanks :sparkles:

patjouk avatar Oct 27 '16 12:10 patjouk

@patjouk yeah, this hasn't been changed yet as far as I can tell

zanderle avatar Oct 27 '16 12:10 zanderle

Confirmed this is still an issue.

ekohl avatar Nov 17 '18 11:11 ekohl