Opened 9 years ago
Last modified 3 weeks ago
#25703 new Cleanup/optimization
Create topic documentation for Expressions
Reported by: | Mikey Ariel | Owned by: | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | josh.smeaton@…, Ülgen Sarıkavak, Clifford Gama | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently this feature has the following docs:
Conditional Expressions - Reference document that contains descriptions and examples of conditional expressions https://docs.djangoproject.com/en/1.8/ref/models/conditional-expressions/
Query Expressions - Full reference about all expressions https://docs.djangoproject.com/en/1.8/ref/models/expressions/
Proposed new content:
- Overview and benefits of expressions
- Use-case example(s)
- Tutorial (move from ref and expand)
- General guidelines and limitations
Change History (11)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
follow-up: 4 comment:3 by , 9 years ago
comment:4 by , 9 years ago
Replying to jarshwah:
Thinking about this a little more, I think what we should be writing topic docs on is "Customising the SQL generated by the ORM". Topic name to be cleaned up.
That's really the entire point of expressions. They let you customise the query. Lookups and Transforms also help with customising the query. Extra and Raw, to a lesser extent, also help with this. I think the topic docs should make this as their focus.
We can then link to Expressions API docs, Lookup/Transform API docs (of which there is already topic docs on how to create your own and why), with a light touch on extra/raw.
Thoughts?
That makes absolute sense, actually. Similar to how we expanded the full-text search docs to encompass all-things-search, we can approach expressions from the functional/user perspective. So something like this:
- Custom SQL operations with the ORM (title WIP) - Overview topic that builds on the basic SQL topic and tells users what we can offer them to extend/customize SQL with the ORM.
- One or more use-case examples of expressions + queries to achieve specific goals (for example, the reporting you wanted to do). These will include scenario>goal>SQL snippet>result, much like a tutorial but lighter.
- Reference sections for APIs and further reading links as needed.
How does that sound? I'm planning to sprint on this on Sunday at PyCon CZ, so if you can provide some basic/raw data for it by then, I can flesh it out and hammer out a draft.
follow-up: 6 comment:5 by , 9 years ago
I'll try and put something together by then. What exactly are you after? Use cases, API usage, and SQL (your point 2 above)? What else can help?
comment:6 by , 9 years ago
Replying to jarshwah:
I'll try and put something together by then. What exactly are you after? Use cases, API usage, and SQL (your point 2 above)? What else can help?
Great, thanks! Other than what you mentioned, it might help to have links/references to existing basic SQL docs so that I can do a comparison and build an "upsell" for the extended functionality.
follow-up: 8 comment:7 by , 9 years ago
Sorry, I haven't had a chance to do very much here. I started writing code with some comments the other day that I'd planned to circle back to and write some prose for. Apparently jetlag is a thing though. See attached what I started with. Hopefully there are some knowledgeable django people at the sprints that can help out.
Here's where I got to: https://github.com/jarshwah/expressions_talk/blob/topicdoc/expressions/topicdoc/models.py
Not sure how helpful that's going to be on it's own unfortunately.
comment:8 by , 9 years ago
Replying to jarshwah:
Sorry, I haven't had a chance to do very much here.
You and me both ;) turns out I need to catch up on my ORM lore before I can tackle this content, but I started researching and will ping you again soon with NEEDINFO as needed. Cheers!
comment:9 by , 4 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:10 by , 8 months ago
Cc: | added |
---|
comment:11 by , 3 weeks ago
Cc: | added |
---|
Thinking about this a little more, I think what we should be writing topic docs on is "Customising the SQL generated by the ORM". Topic name to be cleaned up.
That's really the entire point of expressions. They let you customise the query. Lookups and Transforms also help with customising the query. Extra and Raw, to a lesser extent, also help with this. I think the topic docs should make this as their focus.
We can then link to Expressions API docs, Lookup/Transform API docs (of which there is already topic docs on how to create your own and why), with a light touch on extra/raw.
Thoughts?