Commit Graph

10 Commits

Author SHA1 Message Date
Simon Charette c8b6594305 Fixed #32632, Fixed #32657 -- Removed flawed support for Subquery deconstruction.
Subquery deconstruction support required implementing complex and
expensive equality rules for sql.Query objects for little benefit as
the latter cannot themselves be made deconstructible to their reference
to model classes.

Making Expression @deconstructible and not BaseExpression allows
interested parties to conform to the "expression" API even if they are
not deconstructible as it's only a requirement for expressions allowed
in Model fields and meta options (e.g. constraints, indexes).

Thanks Phillip Cutter for the report.

This also fixes a performance regression in bbf141bcdc.
2021-04-28 12:13:55 +02:00
Mariusz Felisiak 4f600673d7 Refs #32632 -- Added tests for returning a copy when combining Q() objects. 2021-04-28 11:31:17 +02:00
Jonathan Richards 00b0786de5 Fixed #32548 -- Fixed crash when combining Q() objects with boolean expressions. 2021-03-17 21:53:39 +01:00
starryrbs 466920f6d7 Fixed #32450 -- Fixed crash when ANDing/ORing an empty Q() with not pickleable Q().
Regression in bb0b6e5263.
2021-02-18 21:13:24 +01:00
Mads Jensen c59aa9e6aa Added test for combining Q objects with non-Q objects. 2018-03-29 13:58:55 -04:00
Tim Graham 9ba3df8240 Refs #29125 -- Made Q.deconstruct() omit 'query_utils' in the path and _connector='AND' since it's a default value. 2018-02-12 15:23:41 -05:00
Tim Graham b95c49c954 Fixed #29125 -- Made Q.deconstruct() deterministic with multiple keyword arguments. 2018-02-12 14:52:32 -05:00
Tom bb0b6e5263 Fixed #28211 -- Prevented ORing an empty Q() from reducing query join efficiency. 2017-05-25 09:06:25 -04:00
Tim Graham 1c3a6cec2a Refs #28211 -- Added a test for ANDing empty Q()'s.
This test passes to due some logic in Node.add().
2017-05-25 09:02:13 -04:00
Ian Foote 508b5debfb Refs #11964 -- Made Q objects deconstructible. 2017-02-23 20:47:48 -05:00