Commit Graph

309 Commits

Author SHA1 Message Date
Russell Keith-Magee 7bcbc99b9e [1.0.X] Fixed #9493 -- Corrected error handling of formsets that violate unique constraints across the component forms. Thanks to Alex Gaynor for the patch.
Merge of r10682 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 16:04:59 +00:00
Russell Keith-Magee d22290b2ce [1.0.X] Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be callables. Thanks to fas for the report and patch.
Merge of r10652 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02 07:16:30 +00:00
Russell Keith-Magee 23c12c9c2b [1.0.X] Fixed #10134 -- Added unique_for_[date|day|month|year] validation to ModelForm handling. Thanks to Alex Gaynor for the patch.
Merge of r10646 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-30 13:49:14 +00:00
Russell Keith-Magee 960d3172f6 [1.0.X] Fixed #9522 -- Modified handling of values in base serializer so that field subclasses can define their own value_to_string() method for serialization. Thanks to Alex Koshelev for the report and initial patch.
Merge of r10554 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 12:40:43 +00:00
Jacob Kaplan-Moss 734a3ac767 [1.0.X] Fixed the test case from [10399] to be more robust against the order in which test cases are executed. Backport of r10402 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10403 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:54:40 +00:00
Jacob Kaplan-Moss 33173e98c1 [1.0.X] Fixed #10080: `call_command` now takes option defaults into account, sparing individual commands from any difference between `call_command` and being run from the shell. Thanks, Alex Koshelev. Backport of 10400 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10401 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:28:09 +00:00
Jacob Kaplan-Moss 35c30ee957 Fixed #9989: fixed a subtle edge case where removing signals could break. Thanks, ferringb. Backport of r10398 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:21:25 +00:00
Karen Tracey cfe9b6f642 [1.0.X] Replace test use of assertTrue with failUnless. No matter how many times we try, Python 2.3 still doesn't recognize assertTrue.
[10390] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-04 17:54:35 +00:00
Joseph Kocherhans f58df036bd [1.0.x] Backport of r10348 from trunk, plus missing tests that should have been in r10286.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-01 22:35:41 +00:00
Jacob Kaplan-Moss 795697dc22 [1.0.X] Fixed #8746: Check data in raw_id_fields more closely. Thanks, dgouldin
Backport of r10233 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10294 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 21:48:29 +00:00
Jacob Kaplan-Moss 67a5880162 [1.0.X] Fixed #10413: RelatedManager.add no longer fails silenty when trying to add an object of the wrong type. Thanks, dgouldin.
Backport of r10226 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 21:42:47 +00:00
Jacob Kaplan-Moss 7475092c9f [1.0.X] Fixed #10157: correctly set the related objects pk when assigning a reverse OneToOne. Thanks, dgouldin.
Backport of r10224 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 21:15:55 +00:00
Joseph Kocherhans 1e0acd537b [1.0.X] Forms in model formsets and inline formsets can now be deleted even if they don't validate. Related to #9587. Backport of r10283 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10286 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 20:30:05 +00:00
Gary Wilson Jr 9bbf94112f [1.0.X]: Fixed #9978 -- Fixed a KeyError exception that was being raised when using the logout method on the test client on an unauthenticated user, based on patch from ericholscher.
Backport of r10228 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10236 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 23:20:10 +00:00
Joseph Kocherhans 22ac97b17c [1.0.X] Fixed #10149. FileFields? in a form now validate max_length. Based on a patch by Massimo Scamarcia. Backport of r10227 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:56:05 +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
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
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
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 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
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
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
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
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 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 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
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 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
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
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 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
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 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 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
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
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
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