Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1569 closed enhancement (fixed)

[patch] Streaming HttpResponse

Reported by: Maniac <Maniac@…> Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Maniac@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

HttpResponse should be able to accept not only strings but any iterator. This is most useful for streaming files without loading them into memory.

Patches follow.

Attachments (6)

1569.trunk.diff (5.1 KB ) - added by Maniac <Maniac@…> 19 years ago.
Patch for trunk
1569.m-r.diff (5.1 KB ) - added by Maniac <Maniac@…> 19 years ago.
Patch for magic-removal branch
1569.trunk.2.diff (4.9 KB ) - added by Maniac <Maniac@…> 19 years ago.
More correct patch for trunk
1569.m-r.2.diff (5.0 KB ) - added by Maniac <Maniac@…> 19 years ago.
More correct patch for magic-removal
1569.unicode.trunk.diff (2.2 KB ) - added by Maniac <Maniac@…> 19 years ago.
Unicode-aware iterator (trunk)
1569.unicode.m-r.diff (2.2 KB ) - added by Maniac <Maniac@…> 19 years ago.
Unicode-aware iterator (magic-removal)

Download all attachments as: .zip

Change History (15)

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.trunk.diff added

Patch for trunk

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.m-r.diff added

Patch for magic-removal branch

comment:1 by Maniac <Maniac@…>, 19 years ago

Cc: Maniac@… added
Summary: Streaming HttpResponse[patch] Streaming HttpResponse

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.trunk.2.diff added

More correct patch for trunk

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.m-r.2.diff added

More correct patch for magic-removal

comment:2 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [2639]) Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac

comment:3 by django@…, 19 years ago

Unicode is not getting encoded anymore - the content property does the encoding but this is bypassed by accessing the iterator in the handlers.

comment:4 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: closedreopened

Good point, Kieran. I'm reopening.

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.unicode.trunk.diff added

Unicode-aware iterator (trunk)

by Maniac <Maniac@…>, 19 years ago

Attachment: 1569.unicode.m-r.diff added

Unicode-aware iterator (magic-removal)

comment:5 by Maniac <Maniac@…>, 19 years ago

Oops, sorry. I missed this when refactoring 2nd version of the patch.

New patch turns public iterator that is given to a handler into a generator converting unicode to default_charset if necessary.

Kieran, thanks for quick catch!

comment:6 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: reopenedclosed

(In [2675]) Fixed #1569 -- Made streaming HttpResponse unicode-aware

comment:7 by Maniac <Maniac@…>, 19 years ago

Thanks Adrian!

How about the second half of this thing in #1484 ? I've updated those patches for the current code.

comment:8 by Adrian Holovaty, 19 years ago

Good things (and commits) come to those who are patient.

comment:9 by Maniac <Maniac@…>, 19 years ago

Ok, I got it :-)

Note: See TracTickets for help on using tickets.
Back to Top