Django

Code

Ticket #1569 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

[patch] Streaming HttpResponse

Reported by: Maniac <Maniac@SoftwareManiacs.Org> Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Maniac@SoftwareManiacs.Org Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

1569.trunk.diff (5.1 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/01/06 10:19:24.
Patch for trunk
1569.m-r.diff (5.1 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/01/06 10:19:50.
Patch for magic-removal branch
1569.trunk.2.diff (4.9 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/02/06 13:18:10.
More correct patch for trunk
1569.m-r.2.diff (5.0 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/02/06 13:18:38.
More correct patch for magic-removal
1569.unicode.trunk.diff (2.2 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/10/06 23:58:38.
Unicode-aware iterator (trunk)
1569.unicode.m-r.diff (2.2 kB) - added by Maniac <Maniac@SoftwareManiacs.Org> on 04/10/06 23:59:19.
Unicode-aware iterator (magic-removal)

Change History

04/01/06 10:19:24 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.trunk.diff added.

Patch for trunk

04/01/06 10:19:50 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.m-r.diff added.

Patch for magic-removal branch

04/01/06 10:20:16 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • cc set to Maniac@SoftwareManiacs.Org.
  • summary changed from Streaming HttpResponse to [patch] Streaming HttpResponse.

04/02/06 13:18:10 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.trunk.2.diff added.

More correct patch for trunk

04/02/06 13:18:38 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.m-r.2.diff added.

More correct patch for magic-removal

04/09/06 18:54:35 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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

04/10/06 21:27:21 changed by django@kieranholland.com

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

04/10/06 21:34:28 changed by adrian

  • status changed from closed to reopened.
  • resolution deleted.

Good point, Kieran. I'm reopening.

04/10/06 23:58:38 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.unicode.trunk.diff added.

Unicode-aware iterator (trunk)

04/10/06 23:59:19 changed by Maniac <Maniac@SoftwareManiacs.Org>

  • attachment 1569.unicode.m-r.diff added.

Unicode-aware iterator (magic-removal)

04/11/06 00:01:23 changed by Maniac <Maniac@SoftwareManiacs.Org>

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!

04/11/06 08:43:30 changed by adrian

  • status changed from reopened to closed.
  • resolution set to fixed.

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

04/11/06 09:12:10 changed by Maniac <Maniac@SoftwareManiacs.Org>

Thanks Adrian!

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

04/11/06 09:26:58 changed by adrian

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

04/11/06 09:29:37 changed by Maniac <Maniac@SoftwareManiacs.Org>

Ok, I got it :-)


Add/Change #1569 ([patch] Streaming HttpResponse)




Change Properties
Action