Commit Graph

1140 Commits

Author SHA1 Message Date
Malcolm Tredinnick fd5d0cdebb [1.0.X] Fixed #10432 -- Handle all kinds of iterators in queryset filters.
Only consumes the iterators once and works with Python 2.3.

Backport of r9986 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 03:37:47 +00:00
Malcolm Tredinnick 84b890b66e [1.0.X] Fixed #9649 -- Better error handling in model creation.
Previously, you could explicitly assign None to a non-null ForeignKey
(or other) field when creating the model (Child(parent=None), etc). We
now throw an exception when you do that, which matches the behaviour
when you assign None to the attribute after creation.

Thanks to ales.zoulek@gmail.com and ondrej.kohout@gmail.com for some
analysis of this problem.

Backport of r9983 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 04:53:33 +00:00
Malcolm Tredinnick 31e059c9b3 [1.0.X] Improved table join handling for comparisons against NULL.
This fixes a broad class of bugs involving filters that look for missing
related models and fields. Most of them don't seem to have been reported
(the added tests cover the root cause). The exception is that this has
also fixed #9968.

Backport of r9979 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:09:59 +00:00
Malcolm Tredinnick 182301c8df [1.0.X] Fixed #10406 -- Fixed some problems with model inheritance and pk fields.
Manually specifying both a OneToOneField(parent_link=True) and separate a
primary key field was causing invalid SQL to be generated. Thanks to Ramiro
Morales for some analysis on this one.

Backport of r9971 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9973 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:24:30 +00:00
Malcolm Tredinnick dce458cde2 [1.0.X] Fixed #10251 -- Fixed model inheritance when there's also an explicit pk field.
Backport of r9970 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9972 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:23:18 +00:00
Malcolm Tredinnick b57d86f226 [1.0.X] Changed the row count value returned from update queries in some cases.
If an update only affected an ancestor model (not the child), we were
returning 0 for the number of rows updated. This could have been
misleading if the value is used to detect an update occuring. So we now
return the rowcount from the first non-trivial query that is executed
(if any). Still a slight compromise, but better than what we had.

Backport of r9966 from trunk (turns out this *is* a bugfix, since the returned
rowcount is used in Model.save(force_update=True)).

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9969 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 05:40:22 +00:00
Malcolm Tredinnick f1c9080984 [1.0.X] Fixed #10362 -- An update() that only affects a parent model no longer crashes.
This includes a fairly large refactor of the update() query path (and
the initial portions of constructing the SQL for any query). The
previous code appears to have been only working more or less by accident
and was very fragile.

Backport of r9967 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 05:35:10 +00:00
Malcolm Tredinnick 0249177836 [1.0.X] Removed a test that was accidentally merged as part of r9927.
This was testing a feature that doesn't exist in the 1.0.X branch.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 05:19:51 +00:00
Malcolm Tredinnick a899f7c662 [1.0.X] Fixed a misnamed test that was inadvertently hiding an earlier one.
Backport of r9929 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 07:19:55 +00:00
Malcolm Tredinnick 016f12a2c2 [1.0.X] Fixed insert/update handling when no database interaction is required.
Fixed #10205 as part of this.

Backport of r9926 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 01:59:18 +00:00
Malcolm Tredinnick 283c89e4c6 [1.0.X] Fixed #10202 -- Fixed another couple of slicing edge-cases with querysets.
Patch from Alex Gaynor and Ramiro Morales.

Backport of r9924 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 01:35:36 +00:00
Malcolm Tredinnick 106bd0f49e [1.0.X] Fixed #10028 -- Fixed a problem when ordering by related models.
Some results were inadvertently being excluded if we were ordering across a
nullable relation which itself ordering by a non-nullable relation.

Backport of r9916 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-28 03:02:52 +00:00
Karen Tracey c9a63889f6 [1.0.X] Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.
[9902] from trunk.  Also updated svnmerge metadata; all trunk changesets have either been merged or blocked.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9903 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-24 17:28:33 +00:00
Jacob Kaplan-Moss 734376f947 [1.0.X] Fixed #9214: EmailMessage now respects the From header instead of blindly using from_email. Thanks, Tai Lee.
Backport of r9842 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-24 17:02:03 +00:00
Brian Rosner 93b3f89c31 [1.0.X] Fixed #10274 -- Fixed an embarrassing mistake in BaseGenericInlineFormSet.get_queryset. Thanks Zak Johnson for the report and akaihola for the patch.
Backport of r9886 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 04:31:29 +00:00
Russell Keith-Magee c2807db683 [1.0.X] Fixed #10256 -- Corrected the interaction of extra(select=) with values() and values_list() where an explicit list of columns is requested.
Merge of r9837 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9884 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-22 11:18:19 +00:00
Brian Rosner 5db8dc3573 [1.0.X] Fixed #5903 -- DecimalField.get_default() now correctly returns a Decimal object when the model instance was not retrieved from the database. Thanks Justin Driscoll and pigletto.
Backport of r9823 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-11 20:14:24 +00:00
Karen Tracey 962f0dbd77 Fixed #10075: Allowed saving of inline-edited models that use multi-table inheritance.
r9809 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-03 14:24:06 +00:00
Karen Tracey 47ed900b41 [1.0.X] Fixed #10103: Testcase fix for Jython compatibility. Thanks for report and patch leosoto.
r9782 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-23 05:00:09 +00:00
Karen Tracey 709476ae05 [1.0.X] Fixed #10069 -- Fixed the model form unique validation code to not proceed with using, for example, RelatedObjects returned by get_field_by_name as though they were model Fields.
r9777 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-19 19:43:01 +00:00
Karen Tracey 5ce4031a61 [1.0.X] Corrected code in serializers_regress testcase so that, in the case where an exception has been raised, rollback is called before attempting to leave transaction management. With the old code the original exception (IntegrityError on InnoDB) was getting hidden by a transaction management error resulting from attempting to leave transaction management with a pending commit/rollback.
r9773 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-18 22:09:56 +00:00
Matt Boersma f0e35e1bbe [1.0.X] Fixed #5543: callproc() and friends now work with Oracle and our FormatStylePlaceholderCursor.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9768 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 22:24:45 +00:00
Malcolm Tredinnick cc76b89c59 [1.0.X] Fixed #9985 -- qs.values_list(...).values(...) was constructing incorrect SQL.
Backport of r9717 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-08 05:51:15 +00:00
Russell Keith-Magee f2986d89b9 [1.0.X] Fixed #9942 -- Added a to_python handler for FloatField to ensure correct typing of deserialized data before saving. Underlying problem is analogous to #8298, fixed in [8515]. Thanks to David Larlet <larlet@gmail.com> for the report and fix.
Backport of r9695 and r9696 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-03 04:59:05 +00:00
Gary Wilson Jr 3abbb455b2 [1.0.X] Fixed #8245 -- Added a LOADING flag to autodiscover to prevent an admin.py module with errors from raising a spurious AlreadyRegistered exception in a subsequent call to autodiscover.
Backport of r9680 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-23 18:28:22 +00:00
Karen Tracey 73534cd942 [1.0.X] Fixed #9865 -- Allow saving of new inline-edited objects with custom non-auto primary key fields that are not the foreign key to the parent object.
r9664 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9665 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-21 04:58:59 +00:00
Karen Tracey ae5c9b33d0 [1.0.X] Fixed #9859 -- Added another missing force_unicode needed in admin when running on Python 2.3. Many thanks for report & patch with test to nfg.
Also enhanced the new test to hopefully exercise all paths through the get_deleted_objects function, and fixed the errors pointed out by the beefed-up test.

r9656 and r9657 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 17:53:33 +00:00
Malcolm Tredinnick 518c4ca2a8 [1.0.X] Removed one test that is only intended for PostgreSQL from the
visibility of other databases. This basically hides an annoying warning when
running the tests under MySQL.

Backport of r9469 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9651 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 06:48:15 +00:00
Malcolm Tredinnick 0a0aba5f5e [1.0.X] Fixed #9786 -- Fixed inequality checking for django.db.models.fields.file.FieldFile class.
Backport of r9647 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 04:54:29 +00:00
Malcolm Tredinnick 61e36bd7d1 [1.0.X] This fixes a group of problems in the SQL created by QuerySet.exclude()
when used in a few situations where NULL results can appear.

Fixed #8921 (the only ticket I know of that noticed any of these).

Backport of r9590 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 02:47:05 +00:00
Malcolm Tredinnick a8a4743b1d [1.0.X] Fixed #9188 -- Fixed a case where we were generating syntactically invalid SQL in some exclude() queries.
Backport of r9588 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9589 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-07 05:50:26 +00:00
Ian Kelly a261602bd3 [1.0.X] Fixed #9706: made SlugField honor max_length in Oracle, matching the other backends. Backport of [9548] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-02 18:42:30 +00:00
Russell Keith-Magee af6b7cdc63 [1.0.X] Fixed #9736 -- Added quoting to the SQL constraint names generated during table creation. This is to accommodate primary keys with spaces.
Merge of [9543] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-02 13:34:00 +00:00
Karen Tracey df9254c2f3 [1.0.X] Fixed #9615 -- Typo fix to testcase. Thanks jarrow.
r9519 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-21 16:56:24 +00:00
Karen Tracey bdae3cc27d [1.0.X] Fixed #9608: Ensured a Model's default repr() is printable even if its unicode method raises a Unicode error.
r9475 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 19:08:53 +00:00
Malcolm Tredinnick aed11333f1 [1.0.X] Fixed #6052 -- Worked around a bug in MySQLdb with regards to handling
SafeUnicode (handle SafeString similarly, just to be safe). Based on a patch
from sfllaw.

Backport of r9467 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9469 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:57:10 +00:00
Malcolm Tredinnick d7e1856776 [1.0.X] Fixed #3501 -- Fixed date filtering in querysets for nullable date fields. Only affects SQLite.
Backport of r9466 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9468 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:55:10 +00:00
Brian Rosner 781a1763d9 [1.0.X] Fixed #9258 -- Use _default_manager in ForeignKeyRawIdWidget.label_for_value. Thanks nullie for the patch.
Backport of r9444 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9445 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-15 02:21:32 +00:00
Malcolm Tredinnick 014c563662 [1.0.X] Fixed #6948 -- The join filter was escaping the literal value
that was passed in for the connector. This was contrary to what the
documentation for autoescaping said and to what every other filter does
with literal strings as arguments.

This is backwards incompatible for the situation of the literal string
containing one of the five special HTML characters: if you were writing
{{ foo|join:"&" }}, you now have to write {{ foo| join:"&amp;" }}.
Previous behaviour was, as noted, a bug and contrary to what was
documented and expected.

Backport of r9442 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-15 01:24:53 +00:00
Karen Tracey dbe18ce542 [1.0.X] Fixed #9592 -- Create data for the generic_inline_admin test during setup instead of via a fixutre since it uses a content type id which will vary depending on what other tests have been run.
r9438 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-14 14:52:55 +00:00
Brian Rosner f219136e11 [1.0.X] Fixed #9498 -- Handle a formset correctly when the foreign key is not available (for now).
This case pops up with generic foreign key inlines after [9297]. Added tests
to handle future regressions with generic foreign key inlines in the admin.

Thanks markus and danielr for patches.

Backport of [9412] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-13 19:05:49 +00:00
Karen Tracey 2a1c9072fb [1.0.X] Fixed #5079 -- Avoid converting Decimals to floats during save to the database.
[9394] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-12 00:38:48 +00:00
Karen Tracey 21e0efcd64 [1.0.X] Fixed #7064: Made DemicmalField validation support max_digits equal to decimal_places.
r9387 and r9388 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 20:04:42 +00:00
Karen Tracey 8c31bb7ca3 [1.0.X] Fixed #6035 -- Gave the SplitDateTimeField the proper default widget. Thanks dtulig.
r9385 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9386 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 19:46:13 +00:00
Karen Tracey 4a3dcd7f5e [1.0.X] Fixed #8910 -- Added force_unicode during admin log message creation to avoid triggering a Python 2.3 bug. Thanks for the report joshg and patch nfg.
[9383] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 17:26:13 +00:00
Karen Tracey 3ced836c73 [1.0.X] Fixed #9514 -- Made admin change_form template correctly recognize/report when a form has only a single error.
[9371] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-09 18:54:12 +00:00
Karen Tracey dc0389cca0 [1.0.X] Fixed #5748 -- Made floatformat filter round properly on all platforms and handle NaN input correctly on Windows. Also added tests for these cases. Thanks for the report and initial patch to SmileyChris and PJCrosier.
[9369] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-08 01:53:20 +00:00
Karen Tracey 335f4ac03d [1.0.X] Fixed #6160, #9111 -- Consistently apply conditional_escape to form errors and labels when outputing them as HTML.
[9365] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 19:53:36 +00:00
Russell Keith-Magee 6be20bf64c [1.0.X] Fixed #9011 -- Corrected handling of fixture files that contain errors to correctly report the broken fixture name. Thanks to jlrivitti@gmail.com for the report and initial patch.
Merge of [9357] and [9358] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 11:27:33 +00:00
Karen Tracey dcfafea408 [1.0.X] Fixed #9218 -- Simplified the fix from #9039 and added tests to ensure this case doesn't break again (and that the simplification didn't break anything).
[9341] from trunk.  Also updated svnmerge metadata.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9342 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-05 19:55:51 +00:00