summaryrefslogtreecommitdiff
path: root/tests/generic_relations
AgeCommit message (Collapse)Author
2014-10-08Fixed #23611 -- update_or_create failing from a related managerLoic Bistuer
Added update_or_create to RelatedManager, ManyRelatedManager and GenericRelatedObjectManager. Added missing get_or_create to GenericRelatedObjectManager.
2014-09-24Removed numbering from the models.py header of some test packages.Loic Bistuer
This is a reliqua from the early days of the modeltests/regressiontests era.
2014-07-14Fixed #22992 -- regression in .filter(generic_fk=...) error messageAnssi Kääriäinen
Generic Foreign Keys can't be used as lhs in lookups for historical reasons. Django 1.6 gave a FieldDoesNotExist exception when using GFKs as lhs in lookups, but due to regression caused by lookup refactor patch (20bab2cf9d02a5c6477d8aac066a635986e0d3f3) the exception type was changed to AttributeError. It might be a good idea to add support for gfk__exact and gfk__in lookups later on. Thanks to glicerinu@gmail.com for the report. The code in this commit was written by Tim Graham.
2014-06-01Split GenericRelationsTests.test_generic_relations into several tests; refs ↵José L. Patiño
#18586.
2014-03-30Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.Loic Bistuer
Since assignments on M2M or reverse FK descriptors is composed of a `clear()`, followed by an `add()`, `clear()` could potentially affect the value of the assigned queryset before the `add()` step; pre-evaluating it solves the problem. This patch fixes the issue for ForeignRelatedObjectsDescriptor, ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor. It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
2014-03-05Fixed #22207 -- Added support for GenericRelation reverse lookupsGabe Jackson
GenericRelation now supports an optional related_query_name argument. Setting related_query_name adds a relation from the related object back to the content type for filtering, ordering and other query operations. Thanks to Loic Bistuer for spotting a couple of important issues in his review.
2014-01-26Fixed #19774 -- Deprecated the contenttypes.generic module.Simon Charette
It contained models, forms and admin objects causing undesirable import side effects. Refs #16368. Thanks to Ramiro, Carl and Loïc for the review.
2013-11-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-10-21Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol
2013-10-19Removed unused local variables in tests.Tim Graham
2013-10-18Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol
2013-10-18Fixed #21268 -- Fixed E303 pep8 warningsAlasdair Nicol
2013-10-16Fixed #7551 -- Made GFK allow None init argument.Bouke Haarsma
Thanks SamBull for the report.
2013-10-04Fixed #21217 -- Avoid connecting `(pre|post)_init` signals to abstract senders.Simon Charette
2013-09-07Fixed #16869 -- BaseGenericInlineFormSet.save_new should use form's save() ↵Pablo Mouzo
method Thanks mattaustin for the report and Pablo Recio (pyriku) for the patch.
2013-08-21Fixed a regression with get_or_create and virtual fields.Tim Graham
refs #20429 Thanks Simon Charette for the report and review.
2013-08-15Fixed #20895 -- Made check management command warn if a BooleanField does ↵Alasdair Nicol
not have a default value Thanks to Collin Anderson for the suggestion and Tim Graham for reviewing the patch.
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-06-05Fixed #17927 -- Added initial values support for BaseGenericInlineFormSetBojan Mihelac
Thanks Fak3 for the suggestion.
2013-05-23Fixed #17648 -- Add `for_concrete_model` to `GenericForeignKey`.Gavin Wahl
Allows a `GenericForeignKey` to reference proxy models. The default for `for_concrete_model` is `True` to keep backwards compatibility. Also added the analog `for_concrete_model` kwarg to `generic_inlineformset_factory` to provide an API at the form level.
2013-05-21Use assertIsInstance in tests.Marc Tamlyn
Gives much nicer errors when it fails.
2013-05-11Fixed #19939 -- generic relations + split_exclude regressionAnssi Kääriäinen
Added a test, the issue was already fixed (likely by the patch for #19385).
2013-05-09Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and ↵Luke Plant
added '__all__' shortcut This also updates all dependent functionality, including modelform_factory and modelformset_factory, and the generic views `ModelFormMixin`, `CreateView` and `UpdateView` which gain a new `fields` attribute.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner