Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32271 closed Cleanup/optimization (fixed)

Documentation consistency between display views and edit views

Reported by: Carles Pina Estany Owned by: Mariusz Felisiak <felisiak.mariusz@…>
Component: Documentation Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In the "generic display views" (https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-display/#django.views.generic.detail.DetailView) the example is:

class ArticleDetailView(DetailView):

In the "Generic editing views" (https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-editing/#django.views.generic.edit.CreateView.template_name_suffix) the example is:

class AuthorCreate(CreateView):

(note that there is no View after AuthorCreate, like it was in the ArticleDetailView example)

I was expecting it to be either:

class ArticleDetailView(DetailView)

class AuthorCreateView(CreateView)

or:

class ArticleDetail(DetailView)

class AuthorCreate(CreateView)

I'm happy to do a PR of any of the options. I'm slightly inclined for the second one to keep it short and because usually these classes are in views.py.

Change History (12)

comment:1 by Carlton Gibson, 4 years ago

Owner: changed from nobody to Carles Pina Estany
Status: newassigned
Triage Stage: UnreviewedAccepted

Hi Carles. Yes, OK… 😄 I think this fits under the small cosmetic changes not needing a ticket. If you'd like to make a PR Fixed #32271 -- Improved naming consistency in CBV code examples. then that would be great.

comment:2 by Carles Pina Estany, 4 years ago

Thanks Carlton, I'll do it!

comment:3 by Carlton Gibson, 4 years ago

Has patch: set
Patch needs improvement: set

PR

Hey Carles. I see you're midway through. 👍 Please uncheck Patch needs improvement when it's finished and you're ready for review. Thanks.

comment:4 by David Smith, 4 years ago

Easy pickings: set
Owner: Carles Pina Estany removed
Status: assignednew

in reply to:  3 comment:5 by Jack Aitken, 4 years ago

Replying to Carlton Gibson:

Hi Carlton, is this still open or does it need work? Happy to help.

PR

Hey Carles. I see you're midway through. 👍 Please uncheck Patch needs improvement when it's finished and you're ready for review. Thanks.

comment:6 by David Smith, 4 years ago

Hi Jack -- there was work done on the pr I've linked below, but the comments made on the PR need addressing. If you have capacity to finish this off that would be great.

https://github.com/django/django/pull/13869

in reply to:  6 comment:7 by Jack Aitken, 4 years ago

Replying to David Smith:

Thanks, David. I've been reviewing the history and it looks like there were some comments by Mariusz regarding the previous commit. Here's what I can gather from those comments about what should be left alone:

  1. Examples in the tutorials (tutorial04.txt and tutorial05.txt) should be left alone.
  2. HomePageTemplateView should be left as HomePageView.
  3. AboutView should remain as AboutView

Otherwise, I can go through the changes that Carles made create a new PR, if this is all agreeable to you.

comment:8 by Carles Pina Estany, 4 years ago

Thanks Jack for continuing the PR! Really appreciate the continuation :)

in reply to:  8 comment:9 by Jack Aitken, 4 years ago

It's my pleasure, Carles!

PR was made. Here is the link: https://github.com/django/django/pull/14069

comment:10 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Owner: set to Mariusz Felisiak <felisiak.mariusz@…>
Resolution: fixed
Status: newclosed

In 5fd4f22:

Fixed #32271 -- Improved consistency of docs CBV examples.

Co-Authored-By: Carles Pina i Estany <carles@…>

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 9f277c3a:

[3.2.x] Fixed #32271 -- Improved consistency of docs CBV examples.

Co-Authored-By: Carles Pina i Estany <carles@…>

Backport of 5fd4f22d196fbe9913884259ddedad10e6156a44 from master

Note: See TracTickets for help on using tickets.
Back to Top