summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2020-10-29Fixed #32152 -- Fixed grouping by subquery aliases.Christian Klus
Regression in 42c08ee46539ef44f8658ebb1cbefb408e0d03fe. Thanks Simon Charette for the review.
2020-10-28Made small readability improvements.Martin Thoma
2020-10-28Fixed #32143 -- Used EXISTS to exclude multi-valued relationships.Simon Charette
As mentioned in the pre-existing split_exclude() docstring EXISTS is easier to optimize for query planers and circumvents the IN (NULL) handling issue.
2020-10-28Refs #27149 -- Fixed sql.Query identity.Simon Charette
By making Query subclass BaseExpression in 35431298226165986ad07e91f9d3aca721ff38ec the former defined it's identity based off _construct_args which is not appropriate.
2020-10-27Improved naming consistency in BaseManage.contribute_to_class().Nguyen You
Matches signatures of other contribute_to_class() methods.
2020-10-26Fixed #29497 -- Fixed loss of assigned parent when saving child with ↵Hannes Ljungberg
bulk_create() after parent.
2020-10-23Fixed #32134 -- Fixed crash of __range lookup with namedtuple.Adam Johnson
Regression in 8be79984dce7d819879a6e594ca69c5f95a08378. Thanks Gordon Wrigley for the report.
2020-10-21Fixed #26390 -- Disabled grouping by Random().Étienne Beaulé
Thanks to Tzu-ping Chung for the tests.
2020-10-21Fixed #32126 -- Fixed grouping by Case() annotation without cases.Hannes Ljungberg
Co-authored-by: Simon Charette <charettes@users.noreply.github.com>
2020-10-19Fixed #32107 -- Fixed ProtectedError.protected_objects and ↵Hasan Ramezani
RestrictedError.restricted_objects. Regression in 4ca5c565f4dc9e97845036e86416abc5cfde766c and ab3cbd8b9a315911248227208630a020cedca08f. Thanks Vitaliy Yelnik for the report.
2020-10-19Fixed #32116 -- Fixed QuerySet.order_by() crash on EmptyQuerySet with ↵Hannes Ljungberg
union() on a single non-empty ordered queryset.
2020-10-15Refs #32096 -- Made JSONField check respect Meta.required_db_vendor.Mariusz Felisiak
Thanks Simon Charette for the implementation idea.
2020-10-14Refs #32096 -- Fixed ExpressionWrapper crash with JSONField key transforms.Mariusz Felisiak
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd. Thanks Simon Charette and Igor Jerosimić for the report.
2020-10-14Refs #32096 -- Fixed __in lookup crash against key transforms for JSONField.Mariusz Felisiak
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd and 1251772cb83aa4106f526fe00738e51c0eb59122. Thanks Simon Charette and Igor Jerosimić for the report.
2020-10-14Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a ↵David-Wobrock
specific timezone.
2020-10-14Refs #31640 -- Made Extract raise ValueError when using tzinfo with ↵David-Wobrock
Date/TimeField.
2020-10-12Fixed #32098 -- Made FieldFile use FileField.attname.Sultan
After a93425a37f4defdb31d4ca96bb3bf6da21f0b5ce FileDescriptor is a subclass of DeferredAttribute and uses FileField.attname to access the field data, so that custom subclasses can not only save data to files, but also represent the same data with a different data type by attaching FileFiled.name to a particular descriptor. Follow up to a93425a37f4defdb31d4ca96bb3bf6da21f0b5ce.
2020-10-06Refs #20577 -- Deferred filtering of prefetched related querysets by reverse ↵Bob Renwick
m2o relation.
2020-10-05Refs #31926 -- Fixed reverse related identity crash on Q() limit_choices_to.Simon Charette
2020-10-05Fixed #32068 -- Added error messages on get() with filters following ↵Hasan Ramezani
union(), intersection(), and difference().
2020-10-05Fixed #31926 -- Fixed recreating queryset with FilteredRelation when using a ↵David-Wobrock
pickled Query. In a pickled join, the join_fields had the same values, but weren't the same object (contrary to when not pickling the QuerySet).
2020-10-02Fixed #32060 -- Added Random database function.Nick Pope
2020-09-29Fixed #31880 -- Made QuerySet.aggregate() raise FieldError when aggregating ↵David Wobrock
over aggregation aliases.
2020-09-23Fixed #31723 -- Fixed window functions crash with DecimalField on SQLite.Hasan Ramezani
Thanks Simon Charette for the initial patch.
2020-09-21Fixed #31777 -- Added support for database collations to Char/TextFields.Tom Carrick
Thanks Simon Charette and Mariusz Felisiak for reviews.
2020-09-17Fixed #31916 -- Fixed combined queryset crash when combining with ordered ↵Hasan Ramezani
combined querysets.
2020-09-16Fixed #31843 -- Fixed pickling named values from QuerySet.values_list().Kwist
2020-09-15Fixed #32007 -- Fixed queryset crash with Q() annotation and aggregation.Mariusz Felisiak
Thanks Gordon Wrigley for the report. Regression in 8a6df55f2dd5131282084a4edfd48f63fbf8c69a.
2020-09-14Fixed #31990 -- Fixed QuerySet.ordered for GROUP BY queries on models with ↵Mariusz Felisiak
Meta.ordering. Regression in 0ddb4ebf7bfcc4730c80a772dd146a49ef6895f6. Thanks Julien Dutriaux for the report.
2020-09-11Fixed #31943 -- Fixed recreating QuerySet.values()/values_list() when using ↵Hasan Ramezani
a pickled Query.
2020-09-09Fixed #31750 -- Made models.Field equality compare models for inherited fields.Ryan Hiebert
2020-09-02Fixed #31941 -- Corrected FileField.deconstruct() with a callable storage.Brian Helba
2020-09-02Fixed #31948 -- Added tzinfo parameter to TruncDate() and TruncTime().Joe Jackson
2020-08-31Fixed #31952 -- Fixed EmptyFieldListFilter crash with reverse relationships.Federico Jaramillo Martínez
Thanks dacotagh for the report.
2020-08-31Fixed #31965 -- Adjusted multi-table fast-deletion on MySQL/MariaDB.Simon Charette
The optimization introduced in 7acef095d73 did not properly handle deletion involving filters against aggregate annotations. It initially was surfaced by a MariaDB test failure but misattributed to an undocumented change in behavior that resulted in the systemic generation of poorly performing database queries in 5b83bae031. Thanks Anton Plotkin for the report. Refs #23576.
2020-08-31Fixed #31919 -- Resolved output_field of IntegerField subclasses combinations.Simon Charette
2020-08-28Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder ↵Mariusz Felisiak
on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
2020-08-27Fixed #31947 -- Made QuerySet.update_or_create() reuse get_or_create().Alexander
2020-08-26Fixed #31936 -- Fixed __in lookup on key transforms for JSONField.Mariusz Felisiak
This resolves an issue on databases without a native JSONField (MariaDB, MySQL, SQLite, Oracle), where values must be wrapped. Thanks Sébastien Pattyn for the report.
2020-08-26Fixed #31918 -- Allowed QuerySet.in_bulk() to fetch on a single distinct field.Kaustubh
2020-08-13Fixed #31792 -- Made Exists() reuse QuerySet.exists() optimizations.Simon Charette
The latter is already optimized to limit the number of results, avoid selecting unnecessary fields, and drop ordering if possible without altering the semantic of the query.
2020-08-12Fixed #31382 -- Made Model.save(update_fields=...) raise ValueError on ↵Pat Garcia
non-concrete fields.
2020-08-12Fixed #31863 -- Prevented mutating model state by copies of model instances.Gert Burger
Regression in bfb746f983aa741afa3709794e70f1e0ab6040b5.
2020-08-11Fixed #21181 -- Added Collate database function.Tom Carrick
Thanks Simon Charette for reviews.
2020-08-11Fixed #31866 -- Fixed locking proxy models in QuerySet.select_for_update(of=()).Daniel Hillier
2020-08-05Fixed #26977 -- Made abstract models raise TypeError when instantiating.Jacob Walls
2020-07-31Fixed #27719 -- Added QuerySet.alias() to allow creating reusable aliases.Alexandr Tatarinov
QuerySet.alias() allows creating reusable aliases for expressions that don't need to be selected but are used for filtering, ordering, or as a part of complex expressions. Thanks Simon Charette for reviews.
2020-07-30Removed unnecessary list() call in RelatedManager.add().Sergey Fedoseev
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-07-29Fixed #31783 -- Fixed crash when filtering againts "negate" field.Hasan Ramezani
Thanks Simon Charette for the initial patch.