[Django] #25434: Missing documentation for request.site attribute

10 views
Skip to first unread message

Django

unread,
Sep 20, 2015, 6:44:35 AM9/20/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+---------------------
Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+---------------------
When `CurrentSiteMiddleware` was added in 1.7, the documentation for the
attribute `HttpRequest.site` was missed.

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

Django

unread,
Sep 20, 2015, 6:55:31 AM9/20/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+--------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

As mentioned in the [[https://github.com/django/django/pull/5320|PR]],
this should also be backported to 1.7 and 1.8 with `.. versionadded:: 1.7`

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

Django

unread,
Sep 22, 2015, 9:45:02 AM9/22/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


Comment:

It seems a bit odd to me to document attributes that middleware set as
"attributes of `HttpRequest`" but given we have `request.user` documented
like that, I don't see a big reason not to document this other than
`request.user` is far more common (enabled my default in new projects)
than `request.site`. Maybe such attributes could be documented in a
separate section (as a separate ticket) to make it more obvious.

FYI, we aren't making non-critical updates to the 1.7 docs since there's
no workflow for allowing translating those updates, so we'll probably
limit this to 1.8.

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

Django

unread,
Sep 22, 2015, 2:08:19 PM9/22/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by ngnpope):

You've suggested exactly what I was thinking as an alternative - a
separate section detailing the attributes that are added to the request by
middleware. As well as `request.user` and `request.site`, there is also
`request.session` which is set by middleware but currently doesn't mention
the fact. I feel that it is useful to know where these attributes are
meant to come from if they have not been set on the request object.

Would you rather that I just altered this ticket and the pull request
instead of creating a separate ticket? One ticket along the lines of
"separated docs for attributes set by middleware and added missing
entries" seems sufficient.

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

Django

unread,
Sep 22, 2015, 2:16:00 PM9/22/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by timgraham):

Okay with me.

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

Django

unread,
Sep 24, 2015, 1:21:48 PM9/24/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


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

Django

unread,
Oct 22, 2015, 2:29:44 PM10/22/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------+------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_better_patch: 1 => 0


Comment:

[https://github.com/django/django/pull/5465 Updated PR]

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

Django

unread,
Oct 23, 2015, 2:35:01 AM10/23/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------------+-------------------------------------

Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:7>

Django

unread,
Oct 24, 2015, 9:59:27 AM10/24/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------------+-------------------------------------
Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"02ef96c5e58d8d3492b6e38246c8268f1a0de47e" 02ef96c5]:
{{{
#!CommitTicketReference repository=""
revision="02ef96c5e58d8d3492b6e38246c8268f1a0de47e"
Fixed #25434 -- Documented HttpRequest.site and created a section for
middleware attributes.

Thanks Nick Pope for the initial patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:8>

Django

unread,
Oct 24, 2015, 9:59:51 AM10/24/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------------+-------------------------------------
Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"84ec3bfc1111525ee0b21afff870840b2eb13771" 84ec3bf]:
{{{
#!CommitTicketReference repository=""
revision="84ec3bfc1111525ee0b21afff870840b2eb13771"
[1.8.x] Fixed #25434 -- Documented HttpRequest.site and created a section
for middleware attributes.

Thanks Nick Pope for the initial patch.

Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:10>

Django

unread,
Oct 24, 2015, 9:59:51 AM10/24/15
to django-...@googlegroups.com
#25434: Missing documentation for request.site attribute
-------------------------------------+-------------------------------------
Reporter: ngnpope | Owner: ngnpope
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"96c0ba380dfbe96d6ebc8368140d026f6113fe2e" 96c0ba3]:
{{{
#!CommitTicketReference repository=""
revision="96c0ba380dfbe96d6ebc8368140d026f6113fe2e"
[1.9.x] Fixed #25434 -- Documented HttpRequest.site and created a section
for middleware attributes.

Thanks Nick Pope for the initial patch.

Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:9>

Reply all
Reply to author
Forward
0 new messages