[Django] #24458: Documentation often overlooks class-based views

13 views
Skip to first unread message

Django

unread,
Mar 7, 2015, 8:50:13 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------+--------------------
Reporter: danielquinn | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
While the explanation of what CBVs are and why we use them is concise,
there isn't much in the way of covering how to use them with different
components in Django. Many examples show only how to use a feature with
function-based views, with no explanation as to how this would translate
to CBVs. Below I've listed some sections that could use some attention:

* https://docs.djangoproject.com/en/1.7/topics/http/sessions/#setting-
test-cookies
* https://docs.djangoproject.com/en/1.7/topics/http/sessions/#examples
* https://docs.djangoproject.com/en/1.7/topics/auth/default/#the-login-
required-decorator
* https://docs.djangoproject.com/en/1.7/topics/cache/#the-per-view-cache
* https://docs.djangoproject.com/en/1.7/topics/cache/#using-vary-headers
* https://docs.djangoproject.com/en/1.7/topics/cache/#controlling-cache-
using-other-headers
* https://docs.djangoproject.com/en/1.7/topics/pagination/#using-
paginator-in-a-view
* https://docs.djangoproject.com/en/1.7/topics/conditional-view-processing
/#the-condition-decorator

--
Ticket URL: <https://code.djangoproject.com/ticket/24458>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 7, 2015, 8:52:43 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------+---------------------------------------
Reporter: danielquinn | Owner: danielquinn
Type: Uncategorized | Status: assigned
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------+---------------------------------------
Changes (by danielquinn):

* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => danielquinn
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:1>

Django

unread,
Mar 7, 2015, 9:32:53 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------------+-------------------------------------
Reporter: danielquinn | Owner:
Type: | danielquinn
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Hopefully we can do this in a way that doesn't require two examples for
every case. Maybe a more general "translating between function and class-
based views" overview would be useful.

--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:2>

Django

unread,
Mar 7, 2015, 9:41:58 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------------+-------------------------------------
Reporter: danielquinn | Owner:
Type: | danielquinn
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by danielquinn):

I agree, this would be preferable. Should it just be an addendum to the
existing "Class Based Views" page, or something separate?

--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:3>

Django

unread,
Mar 7, 2015, 9:52:52 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------------+-------------------------------------
Reporter: danielquinn | Owner:
Type: | danielquinn
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by danielquinn):

Actually, now that I look at the CBV docs, there appears to be everything
covered there, it just wasn't immediately obvious from the URLs above
where I needed to look to do things like use `@login_required` in a CBV.
Maybe it's just a question of prioritising function-based over class-
based, and that's fine if that's the case, but some way to point to these
docs when referencing things like decorators would be handy.

--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:4>

Django

unread,
Mar 7, 2015, 10:34:50 AM3/7/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------------+-------------------------------------
Reporter: danielquinn | Owner:
Type: | danielquinn
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

Yea, not sure. It seems a bit annoying to link to that doc on every
decorator, but maybe it could be done tastefully.

--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:5>

Django

unread,
Mar 24, 2015, 1:02:53 PM3/24/15
to django-...@googlegroups.com
#24458: Documentation often overlooks class-based views
-------------------------------------+-------------------------------------
Reporter: danielquinn | Owner:
Type: | danielquinn
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
| worksforme

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => worksforme


Comment:

Feel free to reopen if you want to provide a patch. Not sure it's terribly
high priority.

--
Ticket URL: <https://code.djangoproject.com/ticket/24458#comment:6>

Reply all
Reply to author
Forward
0 new messages