| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
queries.
Thanks Anssi Kääriäinen for providing the solution.
|
|
|
|
| |
on_delete for ForeignKey/OneToOneField
|
|
|
|
|
|
|
|
|
|
| |
+ subqueries.
Ticket #24090 was already fixed by
b68212f539f206679580afbfd008e7d329c9cd31, this commit adds tests to
verify this is indeed the case.
Thanks to Beauhurst for commissioning the work on this ticket.
|
|
|
|
|
|
|
| |
subquery.
Thanks to charettes and priidukull for investigating the issue, and to
kurevin for the report.
|
|
|
|
|
|
|
|
| |
Added relabeled_clone() method to sql.Query to fix the problem. It
manifested itself in rare cases where at least double nested subquery's
filter condition might target non-existing alias.
Thanks to Trac alias ris for reporting the problem.
|
|
|
|
|
|
| |
__iter__
Refs #14334
|
|
|
|
|
|
| |
are ignored for ManyToManyField.
Thanks Loic Bistuer and Tim Graham for help and review.
|
|
|
|
|
|
|
| |
types.
Thanks rpbarlow for the suggestion; and loic, akaariai, and jorgecarleitao
for reviews.
|
| |
|
| |
|
|
|
|
| |
Thanks Piotr Kasprzyk for help with the patch.
|
|
|
|
|
| |
It seems this case was fixed somewhere between 1.5.x and 1.6.x. I added
tests as I wasn't able to find any tests for these cases. Refs #21879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
promotion logic
This commit introduced a new class JoinPromoter that can be used to
abstract away join promotion problems for complex filter conditions.
Query._add_q() and Query.combine() now use the new class.
Also, added a lot of comments about why join promotion is done the way
it is.
Thanks to Tim Graham for original report and testing the changes, and
for Loic Bistuer for review.
|
|
|
|
| |
Signed-off-by: Jason Myers <jason@jasonamyers.com>
|
| |
|
|
|
|
|
| |
In queries using .defer() together with .select_related() the values
and fields arguments didn't align properly for resolve_columns().
|
|
|
|
|
|
| |
using F().
The issue was reported against 1.3.x but has been fixed since.
|
|
|
|
|
| |
It's now forbidden to call queryset.update(field=instance) when instance
hasn't been saved to the database ie. instance.pk is None.
|
| |
|
|
|
|
|
|
| |
In cases where the same connection (from model A to model B along the
same field) was needed multiple times in a select_related query, the
join setup code mistakenly reused an existing join.
|
|
|
|
| |
between backends
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sql/query.py add_q method did a lot of where/having tree hacking to
get complex queries to work correctly. The logic was refactored so that
it should be simpler to understand. The new logic should also produce
leaner WHERE conditions.
The changes cascade somewhat, as some other parts of Django (like
add_filter() and WhereNode) expect boolean trees in certain format or
they fail to work. So to fix the add_q() one must fix utils/tree.py,
some things in add_filter(), WhereNode and so on.
This commit also fixed add_filter to see negate clauses up the path.
A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to
.filter(~Q(reversefk__in=a_list)). The reason for this is that only
the immediate parent negate clauses were seen by add_filter, and thus a
tree like AND: (NOT AND: (AND: condition)) will not be handled
correctly, as there is one intermediary AND node in the tree. The
example tree is generated by .exclude(~Q(reversefk__in=a_list)).
Still, aggregation lost connectors in OR cases, and F() objects and
aggregates in same filter clause caused GROUP BY problems on some
databases.
Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
|
|
|
|
|
|
| |
Before there was need to have both .relabel_aliases() and .clone() for
many structs. Now there is only relabeled_clone() for those structs
where alias is the only mutable attribute.
|
|
|
|
| |
the methods that return a QuerySet.
|
|
|
|
|
| |
Also added a little improvement to sql/query.py to get rid of
non-necessary IS NOT NULL check.
|
|
|