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
--
Ticket URL: <https://code.djangoproject.com/ticket/25703>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => thatdocslady
* needs_docs: => 0
* status: new => assigned
* needs_tests: => 0
* needs_better_patch: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:2>
Comment (by 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?
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:3>
Comment (by thatdocslady):
Replying to [comment:3 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:
1. 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.
2. 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.
3. 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:4>
Comment (by 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?
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:5>
Comment (by thatdocslady):
Replying to [comment:5 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:6>
Comment (by jarshwah):
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:7>
Comment (by thatdocslady):
Replying to [comment:7 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!
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:8>
* owner: Mikey Ariel => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/25703#comment:9>