• Anssi Kääriäinen's avatar
    Fixed #10790 -- Refactored sql.Query.setup_joins() · 69597e5b
    Anssi Kääriäinen yazdı
    This is a rather large refactoring. The "lookup traversal" code was
    splitted out from the setup_joins. There is now names_to_path() method
    which does the lookup traveling, the actual work of setup_joins() is
    calling names_to_path() and then adding the joins found into the query.
    
    As a side effect it was possible to remove the "process_extra"
    functionality used by genric relations. This never worked for left
    joins. Now the extra restriction is appended directly to the join
    condition instead of the where clause.
    
    To generate the extra condition we need to have the join field
    available in the compiler. This has the side-effect that we need more
    ugly code in Query.__getstate__ and __setstate__ as Field objects
    aren't pickleable.
    
    The join trimming code got a big change - now we trim all direct joins
    and never trim reverse joins. This also fixes the problem in #10790
    which was join trimming in null filter cases.
    69597e5b
Adı
Son kayıt (commit)
Son güncelleme
..
fixtures Loading commit data...
__init__.py Loading commit data...
models.py Loading commit data...
tests.py Loading commit data...