Comment (by claudep):
The add_module_names directive in docs/conf.py is currently set to False.
If set to True, it would prepend the module path to the class. However,
there are almost 200 module:: or currentmodule:: directives in the
documentation, so I don't know if displaying the full path is always the
desired effect.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* version: => master
Comment:
#19281 was a dupe for the more general sense, so I've updated the summary
to be a bit more generic.
This has always something that has bugged me - and has been somewhere on
my todo list since this tweet crossed my path:
https://twitter.com/doughellmann/statuses/248093601886765056 :
"Python Dev Pro-tip: Include the import statements in each example in your
documentation. Your casual readers will thank you."
So there are two places to add this information:
As information or heading in the reference documentation - and in code
listings.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:6>
Comment (by aaugustin):
#19864 was another duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:7>
Comment (by davesque):
From duplicate #19864, I had thought about Carl's suggestion that the
heading should instead state the full resource path instead of just the
resource name:
'''''class'' django.template.response.TemplateResponse'''
instead of
'''''class'' TemplateResponse'''
I wasn't sure if that would sometimes be too verbose. That's why I had
suggested the alternative:
module: {{{django.template.response}}}
'''''class'' TemplateResponse''
However, I prefer Carl's suggestion if it doesn't disrupt the layout of
the current docs too much.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:8>
Comment (by EvilDMP):
I agree that simply turning on display of modules with `add_module_names`
would be a rather scattershot approach. Module names are not always
provided anyway.
I think that the best approach would be for code samples to include
imports, or at least the first one of a batch of them.
Similarly, if an object's path is not clear from its reasonably immediate
context, then it should be spelled out in full the first time it's
introduced in its reference documentation.
If there's a list of objects all from the same module, the module can be
mentioned once at the top of the list.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:9>
Comment (by denis_g@…):
It would be very nice to have this option somehow available, but disabled
by default if you think it's not good to enable it for all.
For instance, full resource path may be rendered with the `display: none`
style, so people who need it may enable it with the simple CSS rule.
Or there may be some kind of JavaScript magic, which would display the
full resource path on user click or hover, or whatever else.
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:10>
Comment (by timgraham):
One option to display the full module path is something like this:
{{{
#!diff
diff --git a/docs/ref/models/expressions.txt
b/docs/ref/models/expressions.txt
index f74c4f2..d0b4a14 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -360,7 +360,8 @@ output value.
``ExpressionWrapper()`` expressions
-----------------------------------
-.. class:: ExpressionWrapper(expression, output_field)
+.. class:: django.db.models.ExpressionWrapper(expression, output_field)
+ :module:
.. versionadded:: 1.8
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:11>
* owner: nobody => mayela
* status: new => assigned
Comment:
I just added a little note about adding the full path of the class in the
settings file
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:12>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"f1d4a540b29c6766b988852bc302ac036a2d82e2" f1d4a540]:
{{{
#!CommitTicketReference repository=""
revision="f1d4a540b29c6766b988852bc302ac036a2d82e2"
Refs #15396 -- Mentioned full path to GZipMiddleware in documentation.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:13>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"9fa6c737df0cbdc23702b849b793e7f3eb067b3e" 9fa6c737]:
{{{
#!CommitTicketReference repository=""
revision="9fa6c737df0cbdc23702b849b793e7f3eb067b3e"
[3.0.x] Refs #15396 -- Mentioned full path to GZipMiddleware in
documentation.
Backport of f1d4a540b29c6766b988852bc302ac036a2d82e2 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:14>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"f5f4c28bfcf5b1303689ed8d854d5e0d9cfb14ea" f5f4c28b]:
{{{
#!CommitTicketReference repository=""
revision="f5f4c28bfcf5b1303689ed8d854d5e0d9cfb14ea"
[2.2.x] Refs #15396 -- Mentioned full path to GZipMiddleware in
documentation.
Backport of f1d4a540b29c6766b988852bc302ac036a2d82e2 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:15>
* owner: Mar Sánchez => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:16>
* owner: (none) => Akshat verma
* status: new => assigned
Comment:
Try adding add_module_names = False in conf.py
--
Ticket URL: <https://code.djangoproject.com/ticket/15396#comment:17>