mirror of
https://github.com/django/django.git
synced 2025-08-09 05:18:56 +00:00
Fixed #24020 -- Refactored SQL compiler to use expressions
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
This commit is contained in:
parent
b8abfe141b
commit
0c7633178f
41 changed files with 970 additions and 1416 deletions
|
@ -170,7 +170,7 @@ def select_related_descend(field, restricted, requested, load_fields, reverse=Fa
|
|||
if not restricted and field.null:
|
||||
return False
|
||||
if load_fields:
|
||||
if field.name not in load_fields:
|
||||
if field.attname not in load_fields:
|
||||
if restricted and field.name in requested:
|
||||
raise InvalidQuery("Field %s.%s cannot be both deferred"
|
||||
" and traversed using select_related"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue