Commit Graph

408 Commits

Author SHA1 Message Date
Russell Keith-Magee 585b7acaa3 Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by introducing an autogenerated through model.
This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-03 14:02:49 +00:00
Luke Plant 2b2f92ae8e Fixed a bug in r11646 - refs #11402
The one line of code not covered by a test... ;-)


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-24 00:37:01 +00:00
Russell Keith-Magee d56c1ab7f0 Fixed #11886 -- Corrected handling of F() expressions that use parentheses. Thanks to Brent Hagany for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11581 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-16 12:09:47 +00:00
Karen Tracey e6e96d871d Fix the expressions modeltest to work on Pythons earlier than 2.5.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11423 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-08-09 15:44:09 +00:00
Russell Keith-Magee b2f72fc040 Fixed #11527 -- Added unit tests and documentation for the use of F() expressions in single object updates. Thanks to Zachary Voase for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11322 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-24 13:38:36 +00:00
Russell Keith-Magee e522e61a80 Fixed #11392 -- Enforced a predictable result order for a couple of test cases. Thanks to Nathan Auch for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-29 12:29:48 +00:00
Russell Keith-Magee b38cf5db5c Fixed #11311 -- Reverted [10952], Refs #10785. Changeset [10952] caused problems with m2m relations between models that had non-integer primary keys. Thanks to Ronny for the report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-15 11:47:01 +00:00
Russell Keith-Magee 031385e4cc Fixed #11194 -- Corrected loading of Proxy models from fixtures (and, by extension, save_base(raw=True) for Proxy models).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 13:35:39 +00:00
Russell Keith-Magee 81aedbd157 Fixed #10672 -- Altered save_base to ensure that proxy models send a post_save signal.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 13:04:22 +00:00
Russell Keith-Magee 6cd37e0a1f Fixed #10785 -- Corrected a case for foreign key lookup where the related object is a custom primary key. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 04:50:24 +00:00
Russell Keith-Magee 512ee0f528 Fixed #10572 -- Corrected the operation of the defer() and only() clauses when used on inherited models.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-06 06:14:05 +00:00
Gary Wilson Jr d89ba464dd Changes to `ImageFileDescriptor` and `ImageField` to fix a few cases of setting image dimension fields.
* Moved dimension field update logic out of `ImageFileDescriptor.__set__` and into its own method on `ImageField`.
 * New `ImageField.update_dimension_fields` method is attached to model instance's `post_init` signal so that:
   * Dimension fields are set when defined before the ImageField.
   * Dimension fields are set when the field is assigned in the model constructor (fixes #11196), but only if the dimension fields don't already have values, so we avoid updating the dimensions every time an object is loaded from the database (fixes #11084).
 * Clear dimension fields when the ImageField is set to None, which also causes dimension fields to be cleared when `ImageFieldFile.delete()` is used.
 * Added many more tests for ImageField that test edge cases we weren't testing before, and moved the ImageField tests out of `file_storage` and into their own module within `model_fields`.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@10858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-28 05:46:09 +00:00
Jacob Kaplan-Moss c935d7ffe3 Fixed #11134: signals recievers that disconnect during their processing no longer mess things up for other handlers. Thanks, Honza Kral.
While I was at it I also cleaned up the formatting of the docstrings a bit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-20 16:13:55 +00:00
Russell Keith-Magee 2e24596001 Fixed #11116 -- Corrected the deletion of proxy objects. Thanks to Samuel Adam for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-19 13:42:38 +00:00
Russell Keith-Magee b9b9ca334e Fixed #9308 -- Corrected the updated of nullable foreign key fields when deleting objects. Thanks to Bob Thomas for the fix, and markshep for the improvements on the test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-19 12:44:17 +00:00
Karen Tracey 50745cc31e Fixed #11066 -- Corrected 15 duplicate "the"s found in docs and code comments. Thanks kaikuehne.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-17 16:45:28 +00:00
Jacob Kaplan-Moss baaf29895c Fixed #10953, #10955: proxies of proxies now work correctly, though I still don't quite understand why you'd want to do such a thing. Thanks, Armin Ronacher.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11 10:10:03 +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
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 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 a59095af24 Fixed #11030: fixed file uploads on non-utf8 filesystem encoding. Thanks, Honza Kral.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 17:53:23 +00:00
Russell Keith-Magee f259494f82 Fixed #9493 -- Corrected error handling of formsets that violate unique constraints across the component forms. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10682 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 12:17:52 +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 17958fa7a9 Fixed #10134 -- Added unique_for_[date|day|month|year] validation to ModelForm handling. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-30 13:47:39 +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
Russell Keith-Magee cb43898d49 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10554 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-13 12:35:49 +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
Malcolm Tredinnick 604c5bc52a Fixed the tests from #10455 so that they are set up correctly.
The previous versions only worked on SQLite. They failed
catastrophically on MySQL & PostgreSQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-11 02:12:31 +00:00
Jacob Kaplan-Moss de91850944 Fixed #5563: `BooleanField(null=True)` now raises a validation warning telling users to use `NullBooleanField` instead. Thanks, SamBull.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10456 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-09 15:09:35 +00:00
Jacob Kaplan-Moss c0ad626dca Fixed #10647: intermediary tables between two umanaged models are no longer created.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10455 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-09 15:03:31 +00:00
Jacob Kaplan-Moss dd966f081a Fixed the test case from [10399] to be more robust against the order in which test cases are executed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:54:02 +00:00
Jacob Kaplan-Moss 8da2322cad 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10400 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:27:26 +00:00
Jacob Kaplan-Moss 20b598bf3e Fixed #9989: fixed a subtle edge case where removing signals could break. Thanks, ferringb.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10398 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 17:20:38 +00:00
Karen Tracey bb31cf37ff Replace test use of assertTrue with failUnless. No matter how many times we try, Python 2.3 still doesn't recognize assertTrue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-04 17:51:35 +00:00
Joseph Kocherhans dc832d7753 Fixed some silly assumptions about pk's that broke the test suite under postgresql.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-01 22:16:34 +00:00
Joseph Kocherhans 15becf23a9 Forms in model formsets and inline formsets can now be deleted even if they don't validate. Related to #9587.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10283 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-31 19:55:20 +00:00
Jacob Kaplan-Moss 5c321780c2 Fixed #8746: Check data in raw_id_fields more closely. Thanks, dgouldin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 23:00:36 +00:00
Gary Wilson Jr 13ea4a9133 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:52:48 +00:00
Joseph Kocherhans fea6c73538 Fixed #10149. FileFields in a form now validate max_length. Based on a patch by Massimo Scamarcia.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:52:16 +00:00
Jacob Kaplan-Moss 6ce25d3be9 Fixed #10413: RelatedManager.add no longer fails silenty when trying to add an object of the wrong type. Thanks, dgouldin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:41:49 +00:00
Jacob Kaplan-Moss 02e56530c5 Fixed #10157: correctly set the related objects pk when assigning a reverse OneToOne. Thanks, dgouldin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10224 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:38:19 +00:00
Joseph Kocherhans 9face54bb7 Fixed #9284. Fixed #8813. BaseModelFormSet now calls ModelForm.save().
This is backwards-incompatible if you were doing things to 'initial' in BaseModelFormSet.__init__, or if you relied on the internal _total_form_count or _initial_form_count attributes of BaseFormSet. Those attributes are now public methods.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 15:58:52 +00:00
Malcolm Tredinnick 466198c4d9 Added a test for defer() / only() to make sure saving continues to work.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10092 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-19 22:46:28 +00:00
Malcolm Tredinnick 29050ef999 Fixed #5420 -- Added support for delayed loading of model fields.
In extreme cases, some fields are expensive to load from the database
(e.g. GIS fields requiring conversion, or large text fields). This
commit adds defer() and only() methods to querysets that allow the
caller to specify which fields should not be loaded unless they are
accessed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-19 09:06:04 +00:00
Malcolm Tredinnick 61a2708c41 Fixed #10356 -- Added pure-Python inheritance for models (a.k.a proxy models).
Large portions of this are needed for #5420, so I implemented it fully.
Thanks to Ryan Kelly for an initial patch to get this started.

Refs #5420.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 09:47:08 +00:00
Russell Keith-Magee cf7a3fa7f0 Fixed #10512 -- Corrected the handling of extra fields on a ModelForm. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-17 10:30:17 +00:00
Russell Keith-Magee 7be4b9a4c0 Fixed #8164 -- Fields on a ModelForm are now ordered in the order specified in the fields attribute of the ModelForm's Meta class. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15 05:05:26 +00:00
Russell Keith-Magee 6d17020c1a Fixed #10250 -- Added a regression test to ensure that GROUP BY statements are correctly quoted under MySQL. This appears to have been corrected inadvertently since the original report, but the extra regression test will make sure it stays that way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-12 11:52:55 +00:00
Russell Keith-Magee 3c8568a7dc 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 11:19:26 +00:00
Malcolm Tredinnick b4dd4d4bb7 Fixed #3163 -- Add a "Meta.managed" option to models.
This allows a model to be defined which is not subject to database table
creation and removal. Useful for models that sit over existing tables or
database views.

Thanks to Alexander Myodov, Wolfgang Kriesing and Ryan Kelly for the bulk of
this patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 03:35:02 +00:00
Russell Keith-Magee db2a95f6f5 Fixed #5610 -- Added the ability for dumpdata to take individual model names, as well as entire applications. Thanks to David Reynolds for his work on this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-28 05:35:22 +00:00
Russell Keith-Magee e735fe7160 Fixed #4476 -- Added a ``follow`` option to the test client request methods. This implements browser-like behavior for the test client, following redirect chains when a 30X response is received. Thanks to Marc Fargas and Keith Bussell for their work on this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9911 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-27 13:14:59 +00:00
Karen Tracey 5f9ac28856 Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-24 17:24:08 +00:00
Russell Keith-Magee 7d03ca9e86 Fixed #10161 -- Modified evaluation of query expressions to allow for operators that take the form of functions. This is mostly for the benefit of Oracle, but it should prove useful later on. Thanks to Ian for the report and feedback on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-24 11:15:31 +00:00
Russell Keith-Magee 542709d0d1 Fixed #10182 -- Corrected realiasing and the process of evaluating values() for queries with aggregate clauses. This means that aggregate queries can now be used as subqueries (such as in an __in clause). Thanks to omat for the report.
This involves a slight change to the interaction of annotate() and values() clauses that specify a list of columns. See the docs for details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 14:47:59 +00:00
Brian Rosner 4bd24474c0 Fixed #10274 -- Fixed an embarrassing mistake in BaseGenericInlineFormSet.get_queryset. Thanks Zak Johnson for the report and akaihola for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9886 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23 04:30:38 +00:00
Karen Tracey ecc55503f4 Fixed #10196: Restored setting of image file width and height fields lost in r9766, and added tests for this function. Thanks to vicvicvic for the ticket and patch and for Alex for reminding me not to break non-PIL-boxes with the new tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-16 18:34:28 +00:00
Karen Tracey 11bfe72366 Fixed #10121: Restored code lost in r9766 that prevented overwriting an already-set blank=True FileField with blank. This would happen, for instance, in the admin if an object with a FileField was edited/saved but the file not re-uploaded, resulting in the association to the previously-uploaded file being lost. Adding the ability to re-blank FileFields when they are once set is the subject of a different ticket (#7048), for now the pre-9766 behavior here has just been restored in order to avoid unexpected data loss. Thanks to Alex for help in understanding how to fix this without un-doing the intent of r9766.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9840 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-16 17:30:12 +00:00
Brian Rosner e5cd43e588 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-11 20:13:17 +00:00
Karen Tracey addd3df3bd Fixed #7672 -- Added a 'week_day' lookup type. Many thanks to Ross Poulton for the proposal and implementation on all built-in database backends..
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-08 05:08:06 +00:00
Karen Tracey 81ae2afdec Fixed 10075: Allowed saving of inline-edited models that use multi-table inheritance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-03 14:02:09 +00:00
Russell Keith-Magee ecadf67569 Fixed #10127 -- Corrected (no, really, this time!) the way the select_related() cache is populated when annotations are also contained in the query. Thanks to Sylvain Pasche <sylvain.pasche@gmail.com> for the report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-03 11:07:21 +00:00
Russell Keith-Magee cf37e4624a Fixed #7210 -- Added F() expressions to query language. See the documentation for details on usage.
Many thanks to:
    * Nicolas Lara, who worked on this feature during the 2008 Google Summer of Code.
    * Alex Gaynor for his help debugging and fixing a number of issues.
    * Malcolm Tredinnick for his invaluable review notes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-29 10:46:36 +00:00
Russell Keith-Magee 0e15932be3 Fixed #10089 -- Corrected handling of aggregates when the query set contains no items (and the cursor returns None). Thanks to Kyle Fox for the report, and david for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-23 11:03:48 +00:00
Karen Tracey ef22bb7b33 Fixed #10103: Testcase fix for Jython compatibility. Thanks for report and patch leosoto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-23 04:53:18 +00:00
Karen Tracey 795c229ae9 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-19 19:37:31 +00:00
Jacob Kaplan-Moss 6332ad4804 Fixed #10044: You can now assign directly to file fields (`instance.filefield = somefile`). Thanks, Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 21:48:37 +00:00
Russell Keith-Magee cc4e4d9aee Fixed #3566 -- Added support for aggregation to the ORM. See the documentation for details on usage.
Many thanks to:
 * Nicolas Lara, who worked on this feature during the 2008 Google Summer of Code.
 * Alex Gaynor for his help debugging and fixing a number of issues.
 * Justin Bronn for his help integrating with contrib.gis.
 * Karen Tracey for her help with cross-platform testing.
 * Ian Kelly for his help testing and fixing Oracle support.
 * Malcolm Tredinnick for his invaluable review notes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-15 11:06:34 +00:00
Karen Tracey ca33f07e2c 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9664 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-21 04:56:32 +00:00
Malcolm Tredinnick fddc0c589e 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.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9649 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 06:42:19 +00:00
Malcolm Tredinnick 5570b0766d Fixed #9778 -- Added some special casing of the "Join on field 'abc'" error
message. It now gives an extra hint if there's a chance you just made a typo in
the lookup type.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-09 07:03:52 +00:00
Adrian Holovaty b76d7c1dec Added a 'permanent' argument the simple.redirect_to() generic view. It's True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301. This is technically backwards-incompatible if you were using the redirect_to generic view with a format-string key called 'permanent', which is highly, highly unlikely.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 04:53:34 +00:00
Jacob Kaplan-Moss 089ab18c02 Fixed #4924: added support for loading compressed fixtures. Thanks to Lars Yencken and Jeremy Dunck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9527 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-24 20:42:09 +00:00
Karen Tracey 966f652464 Fixed #9615 -- Typo fix to testcase. Thanks jarrow.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-21 16:54:10 +00:00
Malcolm Tredinnick 1418da7ee4 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.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:50:06 +00:00
Karen Tracey 21fa517248 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).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-05 19:47:44 +00:00
Karen Tracey 1515b13d1a 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-04 19:48:35 +00:00
Brian Rosner 83af0b8ff3 Fixed #9494 -- Ensure the foreign key in an inline formset is always present on the forms. Thanks Fugazi for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9326 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-01 22:25:41 +00:00
Brian Rosner 0ea15f5650 Fixed #8882 -- When a foreign key is among the unique_together fields in an inline formset properly handle it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-31 22:07:05 +00:00
Brian Rosner 524a44e20b 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 20:01:03 +00:00
Karen Tracey 34acd39e5d Fixed #9039 take 2 -- Modified the new tests added in [9239] so they pass on Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 16:19:14 +00:00
Karen Tracey 49ef21d9ea Fixed #9039 -- Don't perform unique checks on NULL values, since NULL != NULL in SQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-21 14:04:24 +00:00
Jacob Kaplan-Moss d7c829c98e Yet more file storage testing cleanup for the sake of buildbots; this should be the last of it, I hope.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 22:13:16 +00:00
Jacob Kaplan-Moss c185135068 Be nice to buildbots: switched `modeltests/files` to use a proper isolated directory for file storage
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 20:09:51 +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
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