summaryrefslogtreecommitdiff
path: root/tests/prefetch_related
AgeCommit message (Collapse)Author
2016-05-31[1.10.x] Fixed #26676 -- Prevented prefetching to_attr from caching its ↵Simon Charette
result in through attr. Thanks Ursidours for the report. Backport of 53a5fb3cc0137bebeebc0d4d321dbfe20397b065 from master
2016-05-03Refs #26565 -- Errored nicely when using Prefetch with a values() queryset.Simon Charette
Thanks Maxime Lorant for the report and Anssi for the suggestion.
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-03-02Fixed #26226 -- Made related managers honor the queryset used for ↵Simon Charette
prefetching their results. Thanks Loïc for the suggested improvements and Tim for the review.
2016-03-02Refs #17001 -- Added a test for custom prefetch related queryset on generic ↵Simon Charette
relations.
2016-02-26Fixed #26264 -- Fixed prefetch_related() crashes with values_list(flat=True)Attila Tovt
2016-02-26Fixed #25279 -- Made prefetch_related_objects() public.Adam Chainz
2016-02-23Used setupTestData in prefetch_related tests.Simon Charette
2016-01-26Fixed #25546 -- Prevented duplicate queries with nested prefetch_related().François Freitag
2015-12-17Fixed #25544 -- Removed duplicate ids in prefetch_related() queries.Ian Foote
2015-11-11Refs #25693 -- Added a regression test for `to_attr` validation on forward m2m.Simon Charette
2015-11-10Fixed #25693 -- Prevented data loss with Prefetch and ManyToManyField.Ian Foote
Thanks to Jamie Matthews for finding and explaining the bug.
2015-09-21Renamed descriptor classes for related objects.Aymeric Augustin
The old names were downright confusing. Some seemed to mean the opposite of what the class actually did. The new names follow a consistent nomenclature: (Forward|Reverse)(ManyToOne|OneToOne|ManyToMany)Descriptor. I mentioned combinations that do not exist in the docstring in order to help people who would search for them in the code base.
2015-09-12Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-06-18Fixed #24873 -- Prevented nested Prefetch objects from being overwritten.Gagaro
2015-06-15Fixed #24912 -- Fixed prefetch_related failure for UUIDField primary keysBrian King
This resolves a problem on databases besides PostgreSQL when using prefetch_related with a source model that uses a UUID primary key.
2015-02-06Fixed E265 comment styleCollin Anderson
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-11-03Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag
2014-09-29Fixed flake8 warnings.Tim Graham
2014-09-29Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.Thomas Chaumeny
Thanks Collin Anderson for the review.
2014-09-09Avoid the word "stupid".Aymeric Augustin
There's always a better word.
2014-06-05Reordered setUp code in prefetch_related tests.Aymeric Augustin
This allows these tests to run on databases that reject duplicate NULL values in unique fields e.g. SQL Server. Forward port of 4fb50a9a from stable/1.7.x.
2014-05-21Fixed the ordering of prefetch lookups so that latter lookups can refer to ↵Loic Bistuer
former lookups. Thanks Anssi Kääriäinen and Tim Graham for the reviews. Refs #17001 and #22650.
2014-05-21Fixed #22650 -- Fixed regression on prefetch_related.Loic Bistuer
Regression from f51c1f59 when using select_related then prefetch_related on the reverse side of an O2O: Author.objects.select_related('bio').prefetch_related('bio__books') Thanks Aymeric Augustin for the report and tests. Refs #17001.
2014-04-16Fixed flake8 warnings introduced in recent commits.Simon Charette
2014-04-13Fixed stray comment introduced by d3b71b9.Loic Bistuer
Thanks Claude Paroz for the report.
2014-04-13Fixed #21760 -- prefetch_related used an inefficient query for reverse FK.valtron
Regression introduced by commit 9777442. Refs #21410.
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-03-03Allowed custom querysets when prefetching single valued relationsLoic Bistuer
The original patch for custom prefetches didn't allow usage of custom queryset for single valued relations (along ForeignKey or OneToOneKey). Allowing these enables calling performance oriented queryset methods like select_related or defer/only. Thanks @akaariai and @timgraham for the reviews. Refs #17001.
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-12-23Imported override_settings from its new location.Aymeric Augustin
2013-12-14Fixed E127 pep8 warnings.Loic Bistuer
2013-11-13Fixed #21410 -- prefetch_related() for ForeignKeys with related_name='+'Loic Bistuer
Regression introduced by commit 9777442. Thanks to trac username troygrosfield for the report and test case.
2013-11-07Fixed a couple flake8 warnings.Tim Graham
2013-11-07Fixed #17001 -- Custom querysets for prefetch_related.Loic Bistuer
This patch introduces the Prefetch object which allows customizing prefetch operations. This enables things like filtering prefetched relations, calling select_related from a prefetched relation, or prefetching the same relation multiple times with different querysets. When a Prefetch instance specifies a to_attr argument, the result is stored in a list rather than a QuerySet. This has the fortunate consequence of being significantly faster. The preformance improvement is due to the fact that we save the costly creation of a QuerySet instance. Thanks @akaariai for the original patch and @bmispelon and @timgraham for the reviews.
2013-11-02Fixing E302 ErrorsJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-10-26Fix all violators of E231Alex Gaynor
2013-10-22Fixed E221 pep8 warnings.Tim Graham
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-17Fixed #21285 -- Fixed E121,E122 pep8 warningsAlasdair Nicol
2013-10-11Fixed assorted flake8 errors.Tim Graham
2013-09-03Fixed "indentation is not a multiple of four" pep8 issues.Tim Graham
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-05-28Fixed #20242 - Added a regression test for prefetch_related.Tim Graham
Issue was fixed by removal of chunked reads from QuerySet iteration in 70679243d1786e03557c28929f9762a119e3ac14. Thanks Simeon Visser for the patch.
2013-05-24Fixed #19607 - prefetch_related crashLuke Plant
Thanks to av@rdf.ru and flarno11@yahoo.de for the report.