Commit Graph

1249 Commits

Author SHA1 Message Date
Malcolm Tredinnick 39c450cc6d Fixed #10526 -- More fixes when specifying installed apps using "foo.*".
This adds a case that was missed in r9925: underscore handling.

Backport of r10078 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10079 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 01:08:34 +00:00
Malcolm Tredinnick 97321c7645 [1.0.X] Use plain model.Manager, or suitable proxy, for model saving.
We can't use the default manager in Model.save_base(), since we need to
retrieve existing objects which might be filtered out by that manager. We now
always use a plain Manager instance at that point (or something that can
replace it, such as a GeoManager), making all existing rows in the
database visible to the saving code.

The logic for detecting a "suitable replacement" plain base is the same as for
related fields: if the use_for_related_fields is set on the manager subclass,
we can use it. The general requirement here is that we want a base class that
returns the appropriate QuerySet subclass, but does not restrict the rows
returned.

Fixed #8990, #9527.

Refs #2698 (which is not fixed by this change, but it's the first part of a
larger change to fix that bug.)

Backport of r10056 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15 03:45:32 +00:00
Ian Kelly 0ced9f68f3 [1.0.X] Fixed #10238: coerce TextField values to unicode in the oracle backend. Backport of [10049] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-13 19:58:56 +00:00
Ian Kelly 75cc96bc6f [1.0.X] Backport of [10024] from trunk. Refs #10443: Added Oracle to the #10443 regression test exemption, since we don't yet support it.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 22:50:37 +00:00
Russell Keith-Magee ee0320f634 [1.0.X] Fixed #10271, #10281 -- Fixed the handling multiple inline models that share a common base class and have the link to the inline parent on the base class. Includes modifications that allow the equivalent handling for GenericFields. Thanks to Idan Gazit, Antti Kaihola (akaihola), and Alex Gaynor for their work on this patch.
Backport of r10017 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 12:08:17 +00:00
Malcolm Tredinnick ea350187a5 [1.0.X] Fixed #10439 -- Fixed a subtle test failure caused by r9995.
Thanks to Ramiro Morales for debugging what was going on here.

Backport of r10015 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:55:55 +00:00
Malcolm Tredinnick c545e88b81 [1.0.X] Fixed #10443 -- Fixed model attribute updating after r10004.
Adding a get_db_prep_save() call to the UpdateQuery code path meant it
was being called twice if you updated an existing model attribute. This
change removes that double call and also makes TimeField.to_python() a
little more robust for the benefit of the Oracle backend (just in case).

Backport of r10013 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:26:40 +00:00
Malcolm Tredinnick 055c01103d [1.0.x] Fixed #9508 -- Added an appropriate FileField.__hash__ implementation.
Required because we declare a custom __eq__ method.

Backport of r9997 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 10:01:59 +00:00
Malcolm Tredinnick 7dcf651bc5 [1.0.X] Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits in names.
Patch from carljm.

Backport of r9994 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:41:37 +00:00
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
Karen Tracey 8e4827e506 [1.0.X] Fixed #9418 -- When saving a model form, defer saving of file-type fields until after other fields, so that callable upload_to methods can use data from the other fields. Thanks to Bernd Schlapsi for the report and initial patch.
[9334] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-04 19:54:28 +00:00
Brian Rosner 6c069d2a71 [1.0.X] Fixed #9494 -- Ensure the foreign key in an inline formset is always present on the forms. Thanks Fugazi for the report.
Backport of r9326 from trunk

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-01 22:26:44 +00:00
Brian Rosner 7b80af625b [1.0.X] Fixed #8882 -- When a foreign key is among the unique_together fields in an inline formset properly handle it.
Backport of r9297 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-31 22:09:56 +00:00
Brian Rosner 38d9b0919b [0.5.X] Fixed #9462 -- Set the instance in an inline formset correctly so that None does not get passed through to the queryset. Thanks tobias and copelco for the ticket.
Backport of r9293 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9294 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 20:03:56 +00:00
Karen Tracey 84216ef05e [1.0.X] Fixed #8966 -- Changed is_safe for length_is filter to False, since its return value is a boolean, not a string.
Thanks Thomas Steinacher, carljm, and SmileyChris.

Backport of r9291 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 19:04:59 +00:00
Karen Tracey a8a07c2057 [1.0.X] Fixed #9039 take 2 -- Modified the new tests added in [9240] so they pass on Oracle.
Backport of [9288] from trunk, also updated svnmerge.py metadata.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 16:30:19 +00:00
Karen Tracey bffc238a2f [1.0.X] Fixed #7179 -- Changed breadcrumbs on the add page so that a link to the change view is not included when the user doesn't have permission for that view. Also added tests to ensure the link is not there when it shouldn't be, and there when it should be. Thanks for the report & patch alen__ribic.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 19:18:10 +00:00
Karen Tracey d323ef20d3 [1.0.X] Fixed #9411 -- Changed the test from r9081 to be more robust across different database backends.
Backport of [9254] from trunk (I neglected to mention in the ticket this affected 1.0.X branch).

Also updated svnmerge metadata; all eligible fixes have been backported and all others blocked.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 18:13:35 +00:00
Malcolm Tredinnick 6c85612499 [1.0.X] Backed out r9250. I committed this to the branch by mistake; there's no
bug in functionality fixed by this. Refs #9383.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9253 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 06:15:54 +00:00
Malcolm Tredinnick b52e45193f [1.0.X] Fixed #9406 -- Ensure that each database column is only represented
once in the "ORDER BY" clause of an SQL statement.

Backport of r9251 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 06:11:37 +00:00
Malcolm Tredinnick 43f6136f0f [1.0.X] Fixed #9383 -- Don't open a network connection for sending email if
there's nothing to send. Saves a bit of time when, for example, processing
500-error emails with no ADMINs configured. Based on a patch from Jesse Young.

Backport of r9248 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 04:41:58 +00:00
Karen Tracey 74997f95de [1.0.X] Fixed #9252 -- Moved the try/except protecting against incorrect lookup params to where the error is now raised, and added a test for this case.
Backport of [9245] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-22 23:14:48 +00:00
Karen Tracey 118383c607 [1.0.X] Fixed #3096 -- Make admin list_filters respect limit_choices_to.
Backport of [9241] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-21 19:06:44 +00:00
Karen Tracey bd60c52c3c [1.0.X] Fixed #9039 -- Don't perform unique checks on NULL values, since NULL != NULL in SQL.
Backport of [9239] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-21 14:07:36 +00:00
Malcolm Tredinnick 909371e5e5 [1.0.X] Fixed .distinct() not working with slicing in Oracle, due to the
row numbers necessarily being distinct.

Backport of r9221 from trunk (since Ian doesn't have commit privileges at the
moment).


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-11 00:26:11 +00:00
Jacob Kaplan-Moss 6cfbd52138 [1.0.X] Yet more file storage testing cleanup for the sake of buildbots; this should be the last of it, I hope.
Backport of r9226 from trunk.



git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 22:14:24 +00:00
Jacob Kaplan-Moss 4d692e6af1 [1.0.X] More be-nice-to-the-buildbot: be better about cleaning up files created by the cache/session tests.
Backport of r9924 from trunk.



git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 21:42:26 +00:00
Jacob Kaplan-Moss a47f32449a [1.0.X] Be nice to buildbots: switched `modeltests/files` to use a proper isolated directory for file storage
Backport of r9222 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 20:14:52 +00:00
Karen Tracey 9810648bef [1.0.X] Fixed #9053 -- Allowed for sorting of callable and ModelAdmin methods specified in list_display (added in r8352). Previously attempting to sort on the former would raise an exception and the latter simply didn't sort. Also added tests for this function. Thanks rgl and jenan.
Backport of [9211], also updated svnmerge.py metatdata.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 14:57:34 +00:00
Malcolm Tredinnick ced447ee97 [1.0.X] Fixed #9319 -- Fixed a crash when using the same model field in multiple
unique_together constraints.

Backport of r9208 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 10:11:02 +00:00
Malcolm Tredinnick a9936d0b1c [1.0.X] A queryset that has had ordering removed (order_by()) can have ordering
added again later (order_by('foo')). Or, at least, it can now. Thanks to Ilya
Novoselov for diagnosing the problem here.

Backport of r9206 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9207 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 09:48:21 +00:00
Malcolm Tredinnick 4b687d01ba [1.0.X] Fixed #6748 -- When printing the repr() of querysets, don't load or
display more than 20 objects.

This means that accidentally executing HugeStoryArchive.objects.all() at the
interactive prompt (or in the debug template) won't try to load all 4,233,010
stories into memory and print them out. That would previously cause resource
starvation and other "interesting" crashes.

If you really, really want the previous behaviour (e.g. in a doctest that
prints more than 20 items), display "list(qs)" instead of just "qs".

Backport of r9202 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9205 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:44:17 +00:00
Malcolm Tredinnick 09d84c4d40 [1.0.X] Applying a limit to a queryset that already had an upper limit of 0
wasn't working properly.

Backport of r9201 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9204 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:43:31 +00:00
Malcolm Tredinnick 318c1c32dd [1.0.X] The tests added in r9185 were altering the test environment in bad
ways. Fixed this with proper setUp() and tearDown() methods.

Backport of r9200 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9203 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:42:39 +00:00
Malcolm Tredinnick b3c2cf3d1d [1.0.X] Fixed #9233 -- Allow date and message-id headers to be passed in
manually in email messages. Previously we were creating duplicate headers,
which was bad.

Backport of r9197 from trunk. I'm calling this a bugfix, since the docs are
unclear about which headers you can pass into an EmailMessage constructor.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 12:26:00 +00:00
Malcolm Tredinnick fb4f82f2ea Reverted r9186 -- Committed to the wrong branch (it's a feature addition).
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 09:04:55 +00:00
Malcolm Tredinnick ed48b0b37e Fixed #5888 -- Added methods to the test client to support HEAD, PUT, DELETE
and OPTIONS support. Thanks Scott Barr and Leah Culver.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 08:47:05 +00:00
Malcolm Tredinnick 66c77d03d2 [1.0.X] Fixed #9199 -- We were erroneously only prepending "www" to the domain
if we also needed to append a slash (when PREPEND_WWW=True).

Based on a patch and tests from gonz. Thanks.

Backport of r9184 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 08:26:31 +00:00
Malcolm Tredinnick b5ac7f7918 [1.0.X] Added some better error reporting and path handling when creating template paths.
We now raise UnicodeDecodeError for non-UTF-8 bytestrings (thanks to Daniel
Pope for diagnosing this was being swallowed by ValueError) and allow UTF-8
bytestrings as template directories. (The last bit is arguably a feature-add,
but we allow UTF-8 bytestrings everywhere else, so I'm counting it as a bugfix.)

Refs #8965.

Backport of r9161 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-06 06:37:53 +00:00
Malcolm Tredinnick 571b159dd3 [1.0.X] Fixed #9259 -- Fixed a validation error for Spanish identity card numbers.
Patch from Marc Garcia.

Backport of r9129 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 06:00:55 +00:00
Malcolm Tredinnick ccc2387fd2 [1.0.X] Add internationalisation support to the comment templates. Fixed #8868, #8905
Thanks to zgoda for a patch that did most of the internationalisation part.

Backport of r9119 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:20:00 +00:00
Malcolm Tredinnick 389307025f [1.0.x] Fixed #8803 -- Allow authenticated users without first_name/last_name values set to post comments.
Backport of r9118 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:18:25 +00:00
Malcolm Tredinnick e4bc9e1f4a [1.0.X] Altered a failing url template tag test to work more reliably.
There's no guarantee about the order in which ambiguous patterns are resolved.
The solution is "don't do that" and avoid ambiguity.

This is a port of r9113 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:02:55 +00:00
Malcolm Tredinnick b17453bbc9 [1.0.X] Fixed another case of reverse URL resolving that wasn't working.
This is a similar situation to that fixed in r9087. We weren't merging
multiple levels of include() calls together correctly.

Backported from r9099 on trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9100 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-30 05:57:13 +00:00
Malcolm Tredinnick baa960209f Fixed Queryset.dates() in the presence of extra-select columns.
Any extra(select=...) columns can be ignored in the SQL for dates, since we are
only interested in extracting distinct date values. We were previously
including them by accident and it was generating incorrect SQL.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-28 04:36:10 +00:00
Malcolm Tredinnick 15b0158e39 Fixed #9038 -- Correctly handle URL patterns with the same name (or view name),
declared independently and that differ only by argument signatures.

Patch from Russell Keith-Magee.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-27 06:14:11 +00:00
Malcolm Tredinnick 6c7cf34d69 Fixed #9171 -- Fixed a few places where we were assuming lists instead of
generic sequences in ModelForm structures. Patch from mrmachine.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-27 05:57:10 +00:00
Malcolm Tredinnick 922aba3def Fixed a missing variable initialisation deep in the Query bowels.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-22 00:31:22 +00:00
Malcolm Tredinnick 9931c9e132 Fixed #9125 -- When displaying errors for a form with only hidden fields, make sure the resulting XHTML is correct.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-18 07:16:08 +00:00
Malcolm Tredinnick a27ff1c8ae Fixed #8865 -- Improved the robustness of some file path tests.
Based on a patch from pythonhead@gentoo.org.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-17 09:32:36 +00:00
Adrian Holovaty 8efeaea9dd Fixed #9073 -- Fixed a unit test that broke after [9002]. Thanks, kratorius
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-16 05:52:29 +00:00
Malcolm Tredinnick e47cc781d8 A bug from queryset-refactor days: although the Query class has "group_by" and
"having" attributes, only the former was included in the resulting SQL, meaning
subclasses had to completely duplicate Query.as_sql() if they were using any
kind of grouping filtering on the results.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-11 02:00:27 +00:00
Malcolm Tredinnick d88688014f Fixed #7588 -- Inherit fields from concrete ancestor classes via abstract base
classes. Based on a patch from emulbreh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 18:38:43 +00:00
Malcolm Tredinnick 7bc5db3a88 Changed the tests added in r8898 very slightly so that they don't return
unintended results. Doctests aren't self-contained yet when run as part of
the full suite. Refs #5624, #8835.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8930 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 17:59:09 +00:00
Malcolm Tredinnick 780f239fa7 Fixed #8825 -- Fixed a small error model field setup (on the model class) from
r8855. Patch from Christofer Bernander. Test based on one from cgrady.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 05:53:50 +00:00
Malcolm Tredinnick 61cc4a1eee Fixed #8819 -- Don't include two copies of extra-select columns in the query.
This was triggered by r8794, but was, in fact, fairly fragile before then. The
current fix is the correct way we should be doing this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 03:48:25 +00:00
Malcolm Tredinnick 85ebb91846 Fixed #8669 -- Use a consistent version of create() across the board for
model/field instance creation. Based on a patch from Richard Davies.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8884 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 00:09:33 +00:00
Jacob Kaplan-Moss 0e5faf225c Security fix. Announcement forthcoming.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 21:10:00 +00:00
Brian Rosner c1de41f4d2 Fixed #7973 -- Added exclude to BaseModelAdmin to make everything consistent with the form/formset factories. Refs #8071 to make it easier to get at exclude. Thanks julien for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 17:26:24 +00:00
Jacob Kaplan-Moss 79d2ee3b6d Fixed #8309: subclasses now inherit `GenericForeignKey` correctly. There's also now an internal API so that other "virtual fields" like GFK can be inherited as well. Thanks, msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 15:26:00 +00:00
Jacob Kaplan-Moss 98e1cc92f4 Fixed #8795: unique_together validation no longer fails on model forms that exclude fields included in the check. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 14:20:11 +00:00
Malcolm Tredinnick f31425e8e2 Fixed #7154 -- Inherit all model managers from abstract base classes.
Also added documentation describing how manager inheritance works (and when
manager aren't inherited). Based on some patches from sebastian_noack and
emulbreh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 09:04:54 +00:00
Brian Rosner 0cd5caa6a8 Fixed #8787 -- Fixed failing admin_widgets tests. This fixes ManyToManyRawIdWidget which was broken with [8823]. Thanks Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 06:10:14 +00:00
Malcolm Tredinnick c435975cc7 Fixed #8196 -- Make the model_form tests also pass if you don't have PIL
installed. We weren't relying on PIL previously, but the output was different
if it wasn't installed, which was triggering spurious failures. Patch from
Marty Alchin.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8842 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 03:07:26 +00:00
Malcolm Tredinnick 12f6259903 Fixed #8439 -- Complex combinations of Q-objects (using both conjunctions and
disjunctions) were producing incorrect SQL when nullable relations were
involved. This fixes that.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8832 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 02:16:41 +00:00
Malcolm Tredinnick a9465a75de Fixed a case of incorrect parsing of quanitifers in reg-exp patterns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 23:03:03 +00:00
Brian Rosner ce47d4ab83 Fixed #8648 -- Admin no longer ignores to_field. Thanks for the help Karen Tracey and SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:43:38 +00:00
Jacob Kaplan-Moss fc4948d574 Fixed #8770: made some tests more robust under MySQL. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:28:18 +00:00
Jacob Kaplan-Moss 3a18002bbd Fixed #8210 and #8664: moved `USStateField` and `PhoneNumberField` to `django.contrib.localflavor.us`. This is a backwards-incompatible change, albeit a minor one; just add an aditional `import` and go on your way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:15:35 +00:00
Brian Rosner 7c7ad041b3 Fixed #7975 -- Callable defaults in inline model formsets now work correctly. Based on patch from msaelices. Thanks for your hard work msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 21:28:32 +00:00
Jacob Kaplan-Moss ca7db155aa Fixed #8763: added an explicit ordering to the generic_relations test so that the test results aren't dependant on database ordering.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 21:16:17 +00:00
Jacob Kaplan-Moss d5cc16b471 Fixed #8076: fixed `get_(next/previous)_by_date` when used with subclasses. Thanks, bjornkri and jan_oberst.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 21:04:01 +00:00
Jacob Kaplan-Moss d7e9bb0571 Repaired an oversight from [8772] that let made certain types of fields with choices fail. Fixes #6967 again.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8806 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 19:20:03 +00:00
Jacob Kaplan-Moss ea05e61b2b Fixed #8209: `ModelForm`s now validate unique constraints. Alex Gaynor did much of this work, and Brian Rosner helped as well.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 19:08:08 +00:00
Jacob Kaplan-Moss e545058ba9 Fixed #8354: the MySQL backend no longer raises a cryptic error. Instead, it raises a less-cryptic error. Obiously this isn't a perfect solution by any means, but it'll do until we can revisit timezone handling in the future.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:48:39 +00:00
Jacob Kaplan-Moss 15206298ed Revert [8799]. That wasn't ready for prime-time yet -- thanks, git-svn!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:38:59 +00:00
Jacob Kaplan-Moss 429c87fef8 A failing test for #8354
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:22:34 +00:00
Russell Keith-Magee f55b834c2f Fixed #7302: Corrected quoting of columns in extra_group_by. Thanks to Ivan Sagalaev for the patch and initial test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 12:07:26 +00:00
Malcolm Tredinnick 2d7feda05c Fixed #7512 -- Fixed an oversight when I first fixed ordering on nullable
foreign keys (r7761). Thanks to George Vilches for the test case here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 02:43:55 +00:00
Malcolm Tredinnick 4480645ac3 Fixed #8316 -- Put tighter restrictions on the type of Foreign Key fields
created for MySQL (because MySQL + InnoDB has those restrictions).
Patch from julianb.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 00:49:03 +00:00
Malcolm Tredinnick 7838493b9e Fixed #8726 -- When doing reverse URL resolving, make sure we're consistently
dealing with unicode strings throughout by promoting up from UTF-8 as necessary.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 22:47:25 +00:00
Brian Rosner d511996901 Enforce max_num=1 on inline model formsets that have a unique foreign key to its parent. I snuck in a quick clean up to the inlineformset_factory as well.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8775 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 21:14:46 +00:00
Jacob Kaplan-Moss 3b63953704 Fixed #6967: `ModelForm`s now validate choices. Thanks, mattmcc -- the failing test helped quite a bit.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8772 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 20:11:11 +00:00
Jacob Kaplan-Moss 4ae746b574 Added a `TypedChoiceField` which acts just like `ChoiceField`, except that it
returns a value coerced by some provided function. Refs #6967.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 20:10:50 +00:00
Jacob Kaplan-Moss 86316f0be6 Fixed #7027: template tags now corectly break tokens around strings marked for translation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 18:28:06 +00:00
Malcolm Tredinnick 6390155f5c Added a couple of extra tests to ensure url tag robustness. These are an
attempt to verify #8726.

Refs #8726.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 17:29:49 +00:00
Malcolm Tredinnick e1ea7014ad Fixed #8725 -- Handle empty URL patterns in reverse().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 17:20:40 +00:00
Malcolm Tredinnick 24bacb19de Fixed #5216 -- Fixed a case of a string not being a unicode string.
Thanks to Vadim Fint for the test case.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8761 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 11:39:06 +00:00
Malcolm Tredinnick a63a83e5d8 A rewrite of the reverse URL parsing: the reverse() call and the "url" template tag.
This is fully backwards compatible, but it fixes a bunch of little bugs. Thanks
to SmileyChris and Ilya Semenov for some early patches in this area that were
incorporated into this change.

Fixed #2977, #4915, #6934, #7206.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 11:11:20 +00:00
Brian Rosner 27f9b96fa0 Fixed handling of primary keys in model formsets. Model formsets should now work nicely with custom primary keys that are OneToOneField, ForeignKey and AutoField. Added tests to handle each of them.
Fixes #8241, #8694, #8695 and #8719.

Thanks Karen Tracey, jonloyens, sciyoshi, semenov and magneto for tracking down various parts of this patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 09:49:55 +00:00
Jacob Kaplan-Moss ae72e25b35 Fixed #8716: correctly handle name and email in comments from authenticated users.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 21:30:02 +00:00
Jacob Kaplan-Moss 15644cb255 Fixed #8622: accessing POST after a POST handling exception no longer throws the server into an infinite loop. Thanks to vung for tracking this one down and fixing it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8748 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:56:14 +00:00
Jacob Kaplan-Moss f2d7ee759a Fixed #8710: removed a few stray tabs. Thanks, gkelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:25:40 +00:00
Malcolm Tredinnick c0b53b3dcc Removed the need for ROOT_URLCONF in settings when running Django's core tests
(via runtests.py). It was embarrassing having to explain the need for it to
people, since we ignore whatever setting is passed in.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 05:09:03 +00:00
Malcolm Tredinnick fd0cc45828 [8721] introduced some internal field names. We hide them from the list of
valid field names in debugging output so that it doesn't confuse things.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 04:52:56 +00:00
Malcolm Tredinnick 51836756d0 Fixed a typo from the refactoring in [8455]. With bonus test, too. Thanks, vung.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 22:29:38 +00:00
Malcolm Tredinnick f04123f4df Fixed #8279 -- Multiple many-to-many relations to "self" are now possible.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 21:24:00 +00:00
Jacob Kaplan-Moss c068bc184c Merge branch 'url-tag-asvar'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 19:28:03 +00:00
Brian Rosner d57d490b76 Fixed #7918 -- Allow the foreign key in an inline to be any where in the parent chain. Thanks sil for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8708 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 17:41:40 +00:00
Jacob Kaplan-Moss 6a8dcafb57 Fixed #8278: fixed `QueryDict.update(QueryDict)`. Thanks, julien.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8705 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:49:19 +00:00
Brian Rosner cd0b65bcf7 Fixed #7982 -- Corrected ModelAdmin url dispatching to ensure it matching exactly what it needs and doesn't stomp on primary key space. 'add' is a lost cause for now. This originated from #6470. Thanks jdetaeye for the original patch and basith for providing test cases.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:46:46 +00:00