1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

7216 Commits

Author SHA1 Message Date
Chris Cahoon
94a94bee3b [soc2009/http-wsgi-improvements] Establish the priorities and fallbacks for HttpResponseSendFile methods.
Change the setting to settings.HTTPRESPONSE_SENDFILE_METHOD. If this is set to None, we use handler methods,
but otherwise the header gets set, and we do not send any content. If neither of these are available,
use the FileWrapper fallback in HttpResponseSendFile.

This passes the test suite, but is untested on mod_python. I am still trying to figure out how to
view the headers of a response with the Content-Disposition "attachment."

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-18 02:02:57 +00:00
Chris Cahoon
b0e381929f [soc2009/http-wsgi-improvements] Throw an exception when HttpResponse.codec is set with a bad value. Improved coverage of encoding changes in request and response headers. Refs #10190.
Passes the test suite.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11266 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-17 20:00:13 +00:00
Chris Cahoon
aeaa921a6d [soc2009/http-wsgi-improvements] Add docs that I missed from the patch and reformat HttpResponse.__str__. refs #6527
This and the previous revision on this branch appear to complete all the changes from #6527.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11263 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-17 12:36:29 +00:00
Chris Cahoon
88b1183425 [soc2009/http-wsgi-improvements] Expects content to be iterable throughout `HttpResponse`, with regression tests. HttpResponse.close() is now a no-op. Thanks daonb and stugots!
Passes the test suite.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11262 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-17 11:48:08 +00:00
Chris Cahoon
3e5ab0b8ec [soc2009/http-wsgi-improvements] Fix HttpResponseSendFile indentation issue and set its initial content to be an empty string, for compatibility with ticket refs #6527.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-17 11:47:54 +00:00
Chris Cahoon
a873df6f37 [soc2009/http-wsgi-improvements] Merged up to r12258 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11260 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-17 11:33:35 +00:00
Chris Cahoon
bf66b536a2 [soc2009/http-wsgi-improvements] Added the codec attribute/property to HttpResponse, and added docs for recent work with charsets/codecs.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11214 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-11 02:00:34 +00:00
Chris Cahoon
c53880e2c1 [gsoc2009/http-wsgi-improvements] Clean up imports in django.http and django.http.charsets.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11213 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-10 21:50:19 +00:00
Chris Cahoon
ab67a69ec6 [soc2009/http-wsgi-improvements] HttpResponseSendFile now uses django.core.servers.basehttp.FileWrapper inside __iter__ to provide fallback.
regressiontests.sendfile uses this now, and passes. The fallback was tested
using guppy and apache2 with mod_wsgi for heap issues, and it appears to be
fine. We can go back and look at this again if it becomes an issue.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-10 19:02:34 +00:00
Chris Cahoon
9eab31193a [soc2009/http-wsgi-improvements] Refactor setting 406 status codes in HttpResponse. Accessing HttpResponse.content now evaluates the status_code for side effects.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-09 19:53:18 +00:00
Chris Cahoon
e49fd1ff17 [soc2009/http-wsgi-improvement] Repairs to initial regressiontests.sendfile test to fix temp file usage.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11210 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-09 19:53:12 +00:00
Chris Cahoon
8d979aecbe [soc2009/http-wsgi-improvements] Change HttpResponse.status_code to a property, additional test coverage. Refs #10190.
Improve charset coverage. Change HttpResponse.status_code to property, which checks for a 406 situation. This also required changes to all HttpResponse subclasses, so that their default status_code is set by _status_code, now.

Passes regression test suite, except ones related to sendfile.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11199 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-06 20:06:11 +00:00
Chris Cahoon
4d46aed514 [soc2009/http-wsgi-improvements] Merged up to r11176 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-06 19:58:45 +00:00
Chris Cahoon
33b217296e [soc2009/http-wsgi-improvements] Fix core.handler.BaseHandler.process_request.
Indentation issue.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11149 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-02 00:28:01 +00:00
Chris Cahoon
2d29d6c4f8 [soc2009/http-wsgi-improvements] Initial HttpResponseSendFile support, changes pulled from 03/21/09 patch on refs #2131.
This does not pass the included regression tests. However, since this feature
will be entirely based on these changes, which have already gone through a
great number of iterations, I thought it would be sensible to start here.

All of the work here is ymasuda, mizatservercave, and mrts (apologies if I
missed anyone). I hope to take their work
down the final stretch.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-01 02:51:48 +00:00
Chris Cahoon
4df7e8ed9f [soc2009/http-wsgi-improvements] Merged up to r11127 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-01 02:04:35 +00:00
Chris Cahoon
b0680a2ba5 [soc2009/http-wsgi-improvements] Modified tests/test_client_regress to expect correct behavior, which also fixes conflicts with charset handling in HttpResponse.
The specific cases modified test if the test client will encode the data it posts such that when writers of test views try to use the request, the data will be in the encoding they expect from the tests cases they have written. We do not expect HttpRequest to decode the incoming content yet, so the test views have to be created beforehand so that they decode using the proper codec (which they can determine from the content-type header).

Therefore, once the data is in the view and decoded, we then encode it into settings.DEFAULT_CHARSET, so we can expect normal behavior from HttpResponse, which is for the data to be encoded in settings.DEFAULT_CHARSET. That is what the test cases now assert.

HttpResponse charset handling now passes the entire test suite.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11110 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-25 17:19:53 +00:00
Chris Cahoon
eac54911f5 [soc2009/http-wsgi-improvements] Merged up to 11103 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11109 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-25 15:42:51 +00:00
Chris Cahoon
7acae8f4d8 [soc2009/http-wsgi-improvements] http.HttpResponse now initializes self._codec to None.
Changeset 11030 did not actually pass the regression test suite. This passes all except two tests, from test_client_regress. They expect old behavior (which is that their responses will be encoded in settings.DEFAULT_CHARSET). I am not yet sure if that is the correct expectation for the test to have, so I will do investigations into that.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11040 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 05:18:35 +00:00
Chris Cahoon
a86d5ddc77 [soc2009/http-wsgi-improvements] Moved common code from core.handlers.modpython and core.handlers.wsgi into core.handlers.base.process_request.
Passes regression tests.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 05:01:23 +00:00
Chris Cahoon
bab5ab348e [soc2009/http-wsgi-improvements] Added more tests for #10190, changed logic to pass them. http.charsets.determine_charset now takes the accept_charset header instead of the request.
Passes the test suite, including the extensive tests on HttpResponse's detection of Accept-Charset and finding the codec from content_type. However, it does not test that the codec encodes properly.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-17 20:42:15 +00:00
Chris Cahoon
1896d531cb [soc2009/http-wsgi-improvements] Code and tests in support of http.charsets.determine_charset.
This code determines the charset from a content-type or from the Accept-Charset request header.
The code is fairly well documented, but that will be improved once the code is in closer to a
final form. The codec that corresponds to the charset is also returned, but it is not currently
used by HttpResponse.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-16 16:42:46 +00:00
Chris Cahoon
c435676176 [soc2009/http-wsgi-improvements] Merged up to 11009 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-16 16:27:55 +00:00
Chris Cahoon
3d4f9ec1e6 Fixed #9253 -- Modified the method used to generate constraint names so that it is consistent regardless of machine word size.
NOTE: This change is backwards incompatible for some users.

If you are using a 32-bit platform, you will observe no differences as a
result of this change. However, users on 64-bit platforms may experience
some problems using the `reset` management command.

Prior to this change, 64-bit platforms would generate a 64-bit, 16 character
digest in the constraint name; for example:

ALTER TABLE `myapp_sometable` ADD CONSTRAINT `object_id_refs_id_5e8f10c132091d1e` FOREIGN KEY ...

Following this change, all platforms, regardless of word size, will
generate a 32-bit, 8 character digest in the constraint name; for example:

ALTER TABLE `myapp_sometable` ADD CONSTRAINT `object_id_refs_id_32091d1e` FOREIGN KEY ...

As a result of this change, you will not be able to use the `reset`
management command on any table created with 64-bit constraints. This
is because the the new generated name will not match the historically
generated name; as a result, the SQL constructed by the `reset` command
will be invalid.

If you need to reset an application that was created with 64-bit
constraints, you will need to manually drop the old constraint prior
to invoking `reset`.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:30:47 +00:00
Chris Cahoon
c81aa42bc7 Fixed #11194 -- Corrected loading of Proxy models from fixtures (and, by extension, save_base(raw=True) for Proxy models).
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:30:36 +00:00
Chris Cahoon
1015dad87d Fixed #10672 -- Altered save_base to ensure that proxy models send a post_save signal.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:30:22 +00:00
Chris Cahoon
6ff1f9c3ff Fixed #10785 -- Corrected a case for foreign key lookup where the related object is a custom primary key. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:30:05 +00:00
Chris Cahoon
17fb7b7d5a Fixed #11274 -- Corrected doctests to not cause test failures due to missing newlines. Thanks Honza Kral.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:29:52 +00:00
Chris Cahoon
8b5580286e Fixed #11271 -- Added a translation marker for the list_editable save button. Thanks to dc for the report.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:29:43 +00:00
Chris Cahoon
c85c268720 Fixed #11082 -- Ensured that subqueries used in an exclude(X__in=) clause aren't pre-evaluated. Thanks to Henry Andrews for the report, and clement for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:29:32 +00:00
Chris Cahoon
87c1b6cc23 Fixed #10733 -- Added a regression test for queries with multiple references to multiple foreign keys in only() clauses. Thanks to mrts for the report.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:29:17 +00:00
Chris Cahoon
45e50c00d9 Fixed #10572 -- Corrected the operation of the defer() and only() clauses when used on inherited models.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:29:07 +00:00
Chris Cahoon
cb847aa224 Fixed #9479 -- Corrected an edge case in bulk queryset deletion that could cause an infinite loop when using MySQL InnoDB.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:28:54 +00:00
Chris Cahoon
ae2dd58ab1 Fixed #11087 -- Fixed the Count annotation when used with GeoManager. Thanks to dgouldin for ticket and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:28:41 +00:00
Chris Cahoon
d8aa8ced20 Fixed #11200 -- Now use a set data structure for GoogleMap icons so that they aren't repeated in rendered JavaScript. Thanks to ludifan for ticket and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:28:25 +00:00
Chris Cahoon
5fa44cc855 Fixed a few Python 2.3 incompatibilities that were causing test failures.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10991 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:28:14 +00:00
Chris Cahoon
1acb38da06 Fixed #11216 and #11218 -- Corrected a few typos, thanks buriy.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10990 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:28:00 +00:00
Chris Cahoon
6713e1557d Added test for pickling of a model with an ImageField, refs #11103.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:27:48 +00:00
Chris Cahoon
35f8a3cc50 Updated Argentinian spanish translation, 100% complete as of r10858.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10988 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:27:38 +00:00
Chris Cahoon
f36391ecf5 Changes to ImageFileDescriptor and ImageField to fix a few cases of setting image dimension fields.
* Moved dimension field update logic out of `ImageFileDescriptor.__set__` and into its own method on `ImageField`.
 * New `ImageField.update_dimension_fields` method is attached to model instance's `post_init` signal so that:
   * Dimension fields are set when defined before the ImageField.
   * Dimension fields are set when the field is assigned in the model constructor (fixes #11196), but only if the dimension fields don't already have values, so we avoid updating the dimensions every time an object is loaded from the database (fixes #11084).
 * Clear dimension fields when the ImageField is set to None, which also causes dimension fields to be cleared when `ImageFieldFile.delete()` is used.
 * Added many more tests for ImageField that test edge cases we weren't testing before, and moved the ImageField tests out of `file_storage` and into their own module within `model_fields`.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-13 03:27:25 +00:00
Jacob Kaplan-Moss
2b9cefcdda Created "http-wsgi-improvements" branch for Chris Cahoon's SoC project.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@10855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-27 18:47:21 +00:00
Karen Tracey
7638651cc3 Fixed #11204 -- Corrected typo in the pluralize doc. Thanks martin and SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10849 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-27 16:26:56 +00:00
Karen Tracey
9b19fd7a76 Fixed #11209 -- Added a note to doc on connection.queries that the logged sql may not inlude parameter quoting.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-27 16:20:11 +00:00
Karen Tracey
bdf33b37da Fixed #11215 -- Replaced erroneous catch with except in testing doc.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-27 16:03:51 +00:00
Karen Tracey
5dc30c9fd2 Fixed #11205 -- Made the links to the str method description look the same as the links to the unicode method description in the tutorial part 1. Having one be fully qualified while the other was not was odd-looking.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-26 16:46:56 +00:00
Karen Tracey
5e20adcdf6 Fixed #11202 -- Removed mod_python information from FAQ, as it is no longer the recommended deployment option, in favor of more general pointers to the docs and wiki where deployment is discussed in depth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-26 16:27:12 +00:00
Adrian Holovaty
a251e0ab7e Fixed #11070 -- Removed JING_PATH setting, which was no longer used. Thanks for the patch, seanl
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10840 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-26 05:32:52 +00:00
Adrian Holovaty
9848f888ba Made some small improvements to docs/topics/http/sessions.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10839 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-26 05:29:28 +00:00
Brian Rosner
5d9983d084 Fixed #8857 -- Corrected ref in modelforms documentation and added ref to file upload documentation in form documentation. Thanks Kyle Fox and prairiedogg.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-24 06:46:02 +00:00
Karen Tracey
e258961e4f Fixed #11188 -- Removed incorrect doc note about step being unsupported when slicing query sets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-23 12:58:31 +00:00