[Django] #21588: "Modifying upload handlers on the fly" documentation doesn't replicate internal magic

44 views
Skip to first unread message

Django

unread,
Dec 10, 2013, 5:50:12 AM12/10/13
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-----------------------------------------+--------------------
Reporter: Keryn Knight <django@…> | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------------+--------------------
In the documentation for
[https://docs.djangoproject.com/en/dev/topics/http/file-uploads
/#modifying-upload-handlers-on-the-fly modifying upload handlers on a per-
request basis], the examples given imply that simply instantiating a
Handler onto the `upload_handlers` is equivalent to setting them globally
via [https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-
FILE_UPLOAD_HANDLERS FILE_UPLOAD_HANDLERS], however this isn't the case,
because the `_initialize_handlers` method of `HttpRequest` passes `self`
(ie: the `request` parameter in userland code) to the given handler.

Thus copying or subclassing from one of the default handlers doesn't
necessarily work as expected because `request` is always `None` - which is
perfectly valid according to the arguments for, say, `FileUploadHandler`.

It would be prudent to note that custom handlers, if they need arguments
(including request), should do so at the time of instantiation onto the
upload_handlers list

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

Django

unread,
Dec 10, 2013, 3:42:05 PM12/10/13
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: nobody
<django@…> | Status: new
Type: | Version: master
Cleanup/optimization | Resolution:
Component: Documentation | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


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

Django

unread,
Jun 4, 2016, 7:49:10 PM6/4/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: master
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 berkerpeksag):

* cc: berker.peksag@… (added)
* owner: nobody => berkerpeksag
* has_patch: 0 => 1
* status: new => assigned


Comment:

https://github.com/django/django/pull/6722

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

Django

unread,
Jun 6, 2016, 10:53:25 AM6/6/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: master

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


Comment:

Idea for improvement on the PR.

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

Django

unread,
Jun 7, 2016, 10:27:42 PM6/7/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: master

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 berkerpeksag):

* needs_better_patch: 1 => 0


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

Django

unread,
Jun 9, 2016, 12:52:07 PM6/9/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"8f50ff5b15a742f345dade0848a3fbbf2aff629d" 8f50ff5]:
{{{
#!CommitTicketReference repository=""
revision="8f50ff5b15a742f345dade0848a3fbbf2aff629d"
Fixed #21588 -- Corrected handler initialization in "modifying upload
handlers" example.
}}}

Django

unread,
Jun 9, 2016, 12:52:14 PM6/9/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: master

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

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

In [changeset:"324eaf42f249d07c5cd236798fda50e08aa5c501" 324eaf42]:
{{{
#!CommitTicketReference repository=""
revision="324eaf42f249d07c5cd236798fda50e08aa5c501"
[1.9.x] Fixed #21588 -- Corrected handler initialization in "modifying
upload handlers" example.

Backport of 8f50ff5b15a742f345dade0848a3fbbf2aff629d from master
}}}

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

Django

unread,
Jun 9, 2016, 12:52:21 PM6/9/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: master

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

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

In [changeset:"3b75d1262e8488cbbccfbe0ec186a107ea90dc6e" 3b75d126]:
{{{
#!CommitTicketReference repository=""
revision="3b75d1262e8488cbbccfbe0ec186a107ea90dc6e"
[1.10.x] Fixed #21588 -- Corrected handler initialization in "modifying
upload handlers" example.

Backport of 8f50ff5b15a742f345dade0848a3fbbf2aff629d from master
}}}

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

Django

unread,
Jun 9, 2016, 12:53:07 PM6/9/16
to django-...@googlegroups.com
#21588: "Modifying upload handlers on the fly" documentation doesn't replicate
internal magic
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
<django@…> | berkerpeksag
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: master

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

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

In [changeset:"ba29dfb1911cef5fcbc19f02006e3a73254bdfd6" ba29dfb1]:
{{{
#!CommitTicketReference repository=""
revision="ba29dfb1911cef5fcbc19f02006e3a73254bdfd6"
[1.8.x] Fixed #21588 -- Corrected handler initialization in "modifying
upload handlers" example.

Backport of 8f50ff5b15a742f345dade0848a3fbbf2aff629d from master
}}}

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

Reply all
Reply to author
Forward
0 new messages