sandiegopython / test-driven-django-development

This repository contains materials for a San Diego Python workshop on learning Django with test inspired development
http://test-driven-django-development.readthedocs.org/
Other
102 stars 35 forks source link

Unclear wording on section Blog Entry Detail #113

Closed riseriyo closed 9 years ago

riseriyo commented 10 years ago

Ok, this section was a bit unclear to me. So...

Suggestion: Change wording for the following: "This test fails because we didn’t define the get_absolute_url method for our model (Django Model Instance Documentation). " to: "This test fails because we didn’t define the get_absolute_url method for our Entry model (Django Model Instance Documentation). "

Suggestion: Change wording for the following (*if I am correctly understanding what is supposed to be returned): "Finally we need to create the get_absolute_url() function which should return the entry detail URL for each entry. " to: "Finally we need to create the get_absolute_url() function inside our class Entry which calls on the view, entry_details, in blog/views.py. This view will then return the entry detail URL for each entry."

treyhunner commented 9 years ago

@riseriyo I don't think your second suggestion is correct. The URL is constructed by Django's url resolver because we use django.core.urlresolvers.reverse.

riseriyo commented 9 years ago

@treyhunner Ok, but that section is still unclear to me in the way it was written.

  1. Where are we creating the get_absolute_url() function? Ok, I see where in the next sentences down... Entry class
  2. Maybe it's the part 'entry detail URL for each entry' that's confusing me. Do you mean for each EntryDetail object there is a URL that corresponds to each entry?
  3. Could you add what you stated -- "The URL is constructed by Django's url resolver." and refer to the django.core.urlresolvers.reverse and what it does as a way of making it more clear?

On Fri, Nov 7, 2014 at 5:56 PM, Trey Hunner notifications@github.com wrote:

@riseriyo https://github.com/riseriyo I don't think your second suggestion is correct. The URL is constructed by Django's url resolver because we use django.core.urlresolvers.reverse.

— Reply to this email directly or view it on GitHub https://github.com/pythonsd/test-driven-django-development/issues/113#issuecomment-62240669 .

Ms. Rise Riyo


“Named must your fear be before banish it you can.” - Yoda

treyhunner commented 9 years ago
  1. There's a URL for each Entry object.
  2. We should link to reverse if we don't already, but I'm not sure whether the URL resolver explanation would make things more or less confusing. I wonder how other tutorials handle explanations of reversing URLs.
willingc commented 9 years ago

@treyhunner @riseriyo I went through this section and added some readability changes. I think that I covered Trey's item 1. My recommendation would be to skip URL resolver explanation at this point.

riseriyo commented 9 years ago

I went through section again. Wording is better. But I think adding at least a "Tip" regarding django.core.urlresolvers import reverse should be added as further reading.

Placing the "Tip" under the box of code that displays the get_absolute_url() would be fine.

Tip: For further reading about the utility function, reverse, see the Django documentation on django.core.urlresolvers.reverse at https://docs.djangoproject.com/en/1.7/ref/urlresolvers/

On Sun, Nov 9, 2014 at 7:36 AM, Carol Willing notifications@github.com wrote:

@treyhunner https://github.com/treyhunner @riseriyo https://github.com/riseriyo I went through this section and added some readability changes. I think that I covered Trey's item 1. My recommendation would be to skip URL resolver explanation at this point.

— Reply to this email directly or view it on GitHub https://github.com/pythonsd/test-driven-django-development/issues/113#issuecomment-62307178 .

Ms. Rise Riyo


“Named must your fear be before banish it you can.” - Yoda

willingc commented 9 years ago

@riseriyo Sounds good. I'll make the suggested change :)

willingc commented 9 years ago

@riseriyo For your viewing pleasure 955bb7e7675e4132b62661e423b5895af2ca22b6

riseriyo commented 9 years ago

Thanks much, Ms. Carol. - R

On Sun, Nov 9, 2014 at 11:55 AM, Carol Willing notifications@github.com wrote:

@riseriyo https://github.com/riseriyo For your viewing pleasure 955bb7e https://github.com/pythonsd/test-driven-django-development/commit/955bb7e7675e4132b62661e423b5895af2ca22b6

— Reply to this email directly or view it on GitHub https://github.com/pythonsd/test-driven-django-development/issues/113#issuecomment-62316723 .

Ms. Rise Riyo


“Named must your fear be before banish it you can.” - Yoda

willingc commented 9 years ago

@riseriyo You are very welcome. @treyhunner Give it a look and then I think it is ready to close.