Commit Graph

946 Commits

Author SHA1 Message Date
Karen Tracey 14a6f6cf9a Fixed #11032: close() a file explictly open()'d in a test, so that deleting the file tree it is in doesn't fail on Windows. Thanks bthomas for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11 16:13:29 +00:00
Jacob Kaplan-Moss 2b0903b2c4 Fixed #10404: ImageField height_field and width_field options no longer depend on putting the image field after the height/width fields as they did after r9766.
This bug actually exposed a related handful of inconsistancies in the underlying file handling and wraping, so a few related changes are in here as well:

    * Dimensions are also now calculated the moment the image is assigned to the field instead of upon save.
    * The base `File` object now when possible delegates its closed attribute down to the os-level file it wrapps.
    * In-memory files' `close()` now is a no-op. Without this certain APIs that should be able to handle in-memory files were failing.
    * Accessing `FieldFile.closed` used to open the file. That's silly, and it doesn't any more.
    * Some over-eager error handling was squishing some errors that would normally be raised. One unit test was incorrectly depending on this behavior, so the test was removed.

Thanks to Armin Ronacher for much of this work.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11 09:57:19 +00:00
Russell Keith-Magee 8c2db4ab0f Fixed #10906 -- Added a check for PostgreSQL pre 8.2 when using StdDev/Variance aggregates. Thanks to Richard Davies for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10 09:22:53 +00:00
Russell Keith-Magee b97178f7ec Fixed #10842 -- Corrected parsing of version numbers for PostgreSQL 8.4beta series. Thanks to hgdeoro for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10 09:22:06 +00:00
Russell Keith-Magee 5663258de1 Fixed #10792 -- Ensured that ModelChoiceFields don't provide an empty option when the underlying field has blank=False and there is a default value available. Thanks to carljm for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10 07:44:27 +00:00
Russell Keith-Magee 2c2871b7c3 Fixed #11042 -- Corrected admin inlines for inherited models. Thanks to jsmullyan for the report, and mir for helpful triage work. Patch includes regression test for #8093, and a commented out test for #10992.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-09 11:40:13 +00:00
Jacob Kaplan-Moss c40f715257 Fixed #10687: fixed request parsing when upload_handlers is empty. Thanks, Armin Ronacher.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 17:22:34 +00:00
Jacob Kaplan-Moss 68a890e79f Fixed #7712, #9404, #10249, #10300: a light refactor and cleanup of file storage and the `File` object. Thanks to Armin Ronacher and Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 15:08:09 +00:00
Jacob Kaplan-Moss 2af75b485d Fixed #10825: fixed the 'U' format code to dateformat (and the date/now filter/tag). Thanks to gsong and mir.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 13:39:37 +00:00
Jacob Kaplan-Moss 23fa913676 Fixed #10448: correcting errors on "save as new" now correctly create a new object instead of modifying the old one. Thanks, bastih.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10713 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 12:53:14 +00:00
Jacob Kaplan-Moss 155ab07a5d Fixed #10188: prevent newlines in HTTP headers. Thanks, bthomas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10711 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 11:15:23 +00:00
Jacob Kaplan-Moss a7faf6424a Fixed #8817: get_image_dimensions correctly closes the files it opens, and leaves open the ones it doesn't. Thanks, mitsuhiko.
While I was at it, I converted the file_storage doctests to unit tests.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 10:56:51 +00:00
Jacob Kaplan-Moss 614d881450 Fixed #10750: respect comment=False in inline formsets. Thanks, Koen Biermans.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 09:59:46 +00:00
Gary Wilson Jr 59507753c7 Fixed #9610 -- Fixed duplicate uploaded file name mangling when directory contained a dot and file didn't. Based on patches from fadlytabrani and adurdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 05:50:31 +00:00
Jacob Kaplan-Moss 7caf21aa2e Make sure that all uses of max_length in the test suite use values smaller than 255. If we use max_length > 255 the test suite can't be run on MySQL 4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 18:06:22 +00:00
Jacob Kaplan-Moss fb9ac5729d Fixed #10153: foreign key `gte` and `lte` lookups now work. Thanks, joelhooks and adurdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 16:12:08 +00:00
Jacob Kaplan-Moss bfdb7d26aa Fixed #9659: fixed `wsgi.file_wrapper` in the builtin server. Thanks, mitsuhiko.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 15:39:06 +00:00
Matt Boersma 523da3801d Fixed test suite on Oracle that was broken by using keyword "date" as a field name. Refs #4140 and #10422.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 14:48:04 +00:00
Russell Keith-Magee ae7d9bfad2 Fixed #10899 -- Ensured that log messages for deletions in the admin contain useful descriptions. Thanks to Jeremy Dunck for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10686 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 13:10:59 +00:00
Russell Keith-Magee b5f0aff922 Fixed #10516 -- Corrected admin search when the search_fields definition contains multiple fields on the same base model. Thanks to Zain Memon for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 12:52:43 +00:00
Russell Keith-Magee eb81d5acb3 Fixed #10893 -- Corrected a problem with using list_editable in the admin when the model has a manual primary key. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 11:56:10 +00:00
Russell Keith-Magee 9d28568cb4 Fixed #10275 -- Corrected the edge case of rendering a LogEntry with a contenttype of None. Thanks to Jarek Zgoda for the report, and Peter Bengtsson for the patch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10675 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-05 11:52:03 +00:00
Russell Keith-Magee d7233e7c5a Fixed #9932 -- Added a validation error when an inline tries to exclude the foreign key that provides the link to the parent model. Thanks to david for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10668 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-03 13:39:33 +00:00
Russell Keith-Magee 80a54dd23b Fixed #9362 -- Prevented inline forms from overwriting the content_type_id attribute on objets being inlined. Thanks to carljm for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10667 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-03 13:38:36 +00:00
Russell Keith-Magee f6cca736a0 Fixed #9609 -- Modified the clean method of(Null)Boolean field to accept '1' and '0' as valid inputs. Thanks to psagers for the patch.
This is required to support the use of non-default form widgets such as RadioSelect when the data comes from MySQL, which uses 1/0 to represent booleans.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02 14:52:34 +00:00
Russell Keith-Magee fbf5eaac94 Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be callables. Thanks to fas for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02 07:03:33 +00:00
Russell Keith-Magee 5e2d38465a Fixed #10847 -- Modified handling of extra() to use a masking strategy, rather than last-minute trimming. Thanks to Tai Lee for the report, and Alex Gaynor for his work on the patch.
This enables querysets with an extra clause to be used in an __in filter; as a side effect, it also means that as_sql() now returns the correct result for any query with an extra clause.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-30 15:40:09 +00:00
Russell Keith-Magee 2ba9df2f41 Fixed #10082 -- Modified BaseFormSet so that ordering checks work when the formset is empty. Thanks to Petr Marhoun for the report and test case, and bmathieu for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-28 14:17:18 +00:00
Russell Keith-Magee 6312de0279 Fixed #10288 -- Corrected _has_changed handling of DateTimeInput, DateInput, TimeInput, and SplitDateTimeWidget when a custom date/time format is in use. Thanks to Koen Biermans for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-28 13:19:30 +00:00
Jacob Kaplan-Moss 6d1837a8bf Fixed the tests from [9438] to work consistantly across databases. In particular, it was failing on newer versions of PostgreSQL after [10586].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-22 22:38:14 +00:00
Jacob Kaplan-Moss c00e8d2064 Added a `QuerySet.ordered` property to check if a queryset is already ordered. Refs #10163.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10623 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-22 22:16:19 +00:00
Jacob Kaplan-Moss 6c15b5db60 Fixed #10208: `ModelAdmin` now respects the `exclude` and `field` atributes of custom `ModelForm`s. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-22 15:48:51 +00:00
Jacob Kaplan-Moss ccc8e104ee Fixed #10799: fixed the use of list_editable with model inheritance and custom one-to-one parent links. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 21:03:29 +00:00
Jacob Kaplan-Moss 1e4ad6f118 Fixed #10002: inline file uploads now correctly display prior data. Thanks, dgouldin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 20:29:55 +00:00
Jacob Kaplan-Moss a075422bfc Fixed #9122: generic inline formsets now respect exclude and max_num. Thanks, Alex Robbins.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 20:12:53 +00:00
Jacob Kaplan-Moss 002e3fd9e4 Fixed #9124: fixed `SelectDateWidget` with `required=False`. Thanks, Bernd Schlapsi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 17:35:53 +00:00
Jacob Kaplan-Moss 41260fb931 Fixed #10156: `ModelMultipleChoiceField.clean` now does a single query instead of O(N). Thanks, Alex Gaynor. Also, I ported a few more doctests to unittests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10582 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 15:51:11 +00:00
Matt Boersma 800311964e Fixed introspection test case which caused "ORA-00972: identifier is too long" errors against Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 22:32:48 +00:00
Russell Keith-Magee 419ed44436 Fixed #10363 -- Modified ModelForm handling to ensure that excluded fields can't be saved onto the model. Thanks to jgoldberg for the report, an Alex Gaynor for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:26:08 +00:00
Russell Keith-Magee 6590061a00 Fixed #9948 -- Corrected URLField validation to match RFC1035 (URL analog of #9890). Thanks to kratorius for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10574 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:25:18 +00:00
Russell Keith-Magee 48b459a83e Fixed #9890 -- Modified the regex validation for email addresses to match RFC822/1035. Thanks to ozgur for the report, and kratorius for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:24:27 +00:00
Russell Keith-Magee 6cc0c3887c Fixed #10458 -- Corrected the `next_month` and `previous_month` context variables provided with the generic month_archive view. The value returned now matches the docstring and the generic views documentation. Thanks to fperetti for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 13:23:03 +00:00
Russell Keith-Magee fd3ee7d786 Fixed #9804 -- Corrected the introspection of sequence names. This was causing problems when flushing tables that had many-to-many relations through an inherited table. Thanks to jdimov for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 07:07:51 +00:00
Russell Keith-Magee 0fec0a5d70 Fixed #10237 -- Corrected the handling of self-referential m2m fields when using multi-table inheritance. Thanks to Justin Lilly for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 02:59:40 +00:00
Malcolm Tredinnick e9814029f5 Fixed #10692 -- Fixed DecimalField lookups for extreme values.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 05:32:23 +00:00
Malcolm Tredinnick 8931d8d688 Fixed #10675 -- Added unicode paragraph and line-sep handling to escapejs.
There were a couple of line breaking Unicode characters (\u2028 and
\u2029) that cause Javascript errors, at least in Firefox, if not
escaped. So now we do so. Based on a patch from rleland.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10543 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 04:55:41 +00:00
Malcolm Tredinnick 87e6939372 Fixed #10267 -- Correctly handle IRIs in HttpResponse.build_absolute_uri().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 03:50:47 +00:00
Malcolm Tredinnick 50dbda9a3e Added a test from Jamie Gennis to ensure #9848 doesn't reappear.
The bug itself was fixed at some point in the past months (there have
been a few improvements to update() recently). Fixed #9848.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10528 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 00:13:03 +00:00
Malcolm Tredinnick 92824e7102 Fixed #10738 -- Fixed content type values for deferred and proxy models.
Models with deferred fields, or which are proxying for an existing
model, now return the same ContentType object as the real model they
reflect. Thanks to tomasz.elendt for help with fixing this.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-11 13:22:32 +00:00
Russell Keith-Magee e12e0e18a4 Fixed #10197 -- Corrected pickling of querysets when a subset of fields was selected.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-11 13:20:51 +00:00