summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2021-02-24[3.2.x] Fixed #32478 -- Included nested columns referenced by subqueries in ↵Simon Charette
GROUP BY on aggregations. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Refs #31094, #31150. Thanks Igor Pejic for the report. Backport of 277eea8fcced7f04f3800617f189beb349a3212e from master
2021-02-19[3.2.x] Fixed #32455 -- Allowed right combining Q() with boolean expressions.Hasan Ramezani
Backport of f2bef2b7bc6c817af0f5fa77e1052a1f5ce12f71 from master
2021-02-18[3.2.x] Fixed #32450 -- Fixed crash when ANDing/ORing an empty Q() with not ↵starryrbs
pickleable Q(). Regression in bb0b6e526340e638522e093765e534df4e4393d2. Backport of 466920f6d726eee90d5566e0a9948e92b33a122e from master
2021-02-11[3.2.x] Fixed #32433 -- Added error message on QuerySet.delete() following ↵Egidijus Macijauskas
distinct(). Backport of 6307c3f1a123f5975c73b231e8ac4f115fd72c0d from master
2021-02-04[3.2.x] Refs #32074 -- Fixed TextChoices/IntegerChoices crash on Python 3.10.Mariusz Felisiak
EnumMeta has a new keyword argument 'boundary' in Python 3.10. This is a new mechanism that controls how out-of-range / invalid bits are handled, see https://bugs.python.org/issue38250. Backport of 5d9b065d3f93de056588dfee6f1776294dd8bab2 from master
2021-02-04[3.2.x] Fixed #32332 -- Fixed loss of parent with non-numeric pk when saving ↵Hasan Ramezani
child after parent. Follow up to 519016e5f25d7c0a040015724f9920581551cab0. Backport of 7cba92ec55a5d05450261f375830619870ca84fa from master
2021-01-29[3.2.x] Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in ↵Tilman Koschnick
expressions. Backport of fdfbc66331292def201c9344e3cd29fbcbcd076a from master
2021-01-21[3.2.x] Fixed #32367 -- Fixed system check for specifying type of ↵Mariusz Felisiak
auto-created primary keys for inherited PKs. Regression in b5e12d490af3debca8c55ab3c1698189fdedbbdb. Thanks אורי for the report. Backport of a03a36121d22c8784985c7e45727eddef6a3ea7f from master
2021-01-14Fixed #32321 -- Added system checks for invalid model field names in ↵Hasan Ramezani
functional indexes.
2021-01-13Fixed #26167 -- Added support for functional indexes.Hannes Ljungberg
Thanks Simon Charette, Mads Jensen, and Mariusz Felisiak for reviews. Co-authored-by: Markus Holtermann <info@markusholtermann.eu>
2021-01-12Refs #26709 -- Made Index raise ValueError on non-string fields.Hannes Ljungberg
2021-01-05Fixed #32231 -- Allowed passing None params to QuerySet.raw().Alexander Lyabah
2020-12-30Fixed #32294 -- Prevented ManyToManyField's hidden related name collisions ↵manav014
between apps.
2020-12-29Added app labels to related fields checks messages E302-E305.Mariusz Felisiak
2020-12-29Used model's Options.label where applicable.Mariusz Felisiak
Follow up to b7a3a6c9ef0a89625881b47594120bca55fa2e49.
2020-12-23Refs #26167 -- Made DatabaseSchemaEditor._create_index_sql()'s fields ↵Hannes Ljungberg
argument optional and kwarg-only.
2020-12-16Fixed #32089 -- Fixed prefetch_related_objects() when some objects are ↵Alexey Nigin
already fetched. Thanks Dennis Kliban for the report and Adam Johnson for the initial patch. Co-authored-by: Adam Johnson <me@adamj.eu>
2020-12-15Fixed #31007 -- Allowed specifying type of auto-created primary keys.Tom Forbes
This also changes the default type of auto-created primary keys for new apps and projects to BigAutoField.
2020-12-11Fixed #32252 -- Fixed __isnull=True on key transforms on SQLite and Oracle.sage
__isnull=True on key transforms should not match keys with NULL values.
2020-12-07Removed lhs_only argument from KeyTransform.preprocess_lhs().sage
2020-12-02Fixed #32179 -- Added JSONObject database function.Artur Beltsov
2020-11-27Fixed #25534, Fixed #31639 -- Added support for transform references in ↵Ian Foote
expressions. Thanks Mariusz Felisiak and Simon Charette for reviews.
2020-11-25Fixed #32203 -- Fixed QuerySet.values()/values_list() crash on key ↵sage
transforms with non-string values on SQLite. Thanks Gordon Wrigley for the report.
2020-11-24Simplified JSONField key transforms by using JSON_OBJECT() on Oracle.Mariusz Felisiak
2020-11-19Fixed #32200 -- Fixed grouping by ExpressionWrapper() with Q objects.Hasan Ramezani
Thanks Gordon Wrigley for the report. Regression in df32fd42b84cc6dbba173201f244491b0d154a63.
2020-11-16Fixed #31507 -- Added QuerySet.exists() optimizations to compound queries.David-Wobrock
2020-11-14Fixed #31496 -- Fixed QuerySet.values()/values_list() crash on combined ↵David-Wobrock
querysets ordered by annotations.
2020-11-10Fixed #32182 -- Fixed crash of JSONField nested key transforms with subquery ↵Hannes Ljungberg
annotations on PostgreSQL.
2020-11-04Fixed #31910 -- Fixed crash of GIS aggregations over subqueries.Simon Charette
Regression was introduced by fff5186 but was due a long standing issue. AggregateQuery was abusing Query.subquery: bool by stashing its compiled inner query's SQL for later use in its compiler which made select_format checks for Query.subquery wrongly assume the provide query was a subquery. This patch prevents that from happening by using a dedicated inner_query attribute which is compiled at a later time by SQLAggregateCompiler. Moving the inner query's compilation to SQLAggregateCompiler.compile had the side effect of addressing a long standing issue with aggregation subquery pushdown which prevented converters from being run. This is now fixed as the aggregation_regress adjustments demonstrate. Refs #25367. Thanks Eran Keydar for the report.
2020-11-02Fixed #32132 -- Fixed column types in m2m intermediary tables for ↵David-Wobrock
Positive(Big/Small)IntegerFields.
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().