Opened 12 years ago
Last modified 8 months ago
#19898 new New feature
Document why/when of class-based views
Reported by: | Steven Cummings | Owned by: | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | docs sprint2013 |
Cc: | Ülgen Sarıkavak | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The documentation for class-based views is getting better, but it's missing an introductory discussion of why and when you use them. Specifically, the goals of such a narrative should be:
- Practical context for choosing CBVs vs. FBVs
- Usage patterns appropriate to class-based views
- List of helpful, concrete decision points from the above discussion
Hopefully this can be something that people point to for diffusing absolutist arguments for CBVs or FBVs, and the community can start to agree when each is right (a bit of a grandiose goal, yes, but it should be possible).
New documentation that may arise out of the above needs:
- How to test class-based views (and comparison with testing FBVs)
Ticket #19227 aims to provide visualizations code flows in class-based views and so may interact with some of the changes made on this ticket.
Change History (14)
comment:1 by , 12 years ago
comment:3 by , 12 years ago
Going to be working over here: https://github.com/estebistec/django/tree/cbvs-choice-usage
Humble beginnings with an introductory blurb: https://github.com/estebistec/django/commit/34e29c62e5c3c072ab49fb089ecb3d34a8d48ae7
comment:4 by , 12 years ago
From the intro text on the topic index page, there will likely be two new pages:
- usage-patterns
- testing
/plan
comment:5 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 12 years ago
Keywords: | sprint2013 added |
---|
comment:7 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:8 by , 12 years ago
Welp, I should have figured working on CBV docs might not be easily wrapped up in a weekend. So I'm already assuming that this is only the start for this effort and I'll plan to continue and see it through. The biggest thing with a larger doc effort like this is that I need to do the due diligence of having others check perspective and voice of the narrative, in addition to commenting on the clarity of the details.
I think I've got some decent content, but I'd like more compelling examples for usage patterns, as I don't think I'm yet succeeding in differentiating class and function based views in a way people haven't already discussed, save for maybe my testing discussion.
So, core devs, if you have a moment I wouldn't mind some comments on my current direction before I continue.
My current efforts live in a pull request here: https://github.com/django/django/pull/840
comment:9 by , 12 years ago
Also, I'd like to do a survey of all the examples in existing CBV docs and make sure they are complete and independent (meaning views are wired to URLs, all necessary imports are present, etc.) That'll come after I get this new usage-pattern page worked out better.
comment:10 by , 12 years ago
Component: | Uncategorized → Documentation |
---|
comment:11 by , 12 years ago
Type: | Uncategorized → New feature |
---|
comment:12 by , 11 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
comment:13 by , 4 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:14 by , 8 months ago
Cc: | added |
---|
#16807 contains a bunch of text that may be useful to build on for this.