Giter Site home page Giter Site logo

Comments (2)

jatinwatts avatar jatinwatts commented on July 22, 2024

I think their will be change in the following function.

def join(self, join, reuse=None, reuse_with_filtered_relation=False):
    """
    Return an alias for the 'join', either reusing an existing alias for
    that join or creating a new one. 'join' is either a base_table_class or
    join_class.

    The 'reuse' parameter can be either None which means all joins are
    reusable, or it can be a set containing the aliases that can be reused.

    The 'reuse_with_filtered_relation' parameter is used when computing
    FilteredRelation instances.

    A join is always created as LOUTER if the lhs alias is LOUTER to make
    sure chains like t1 LOUTER t2 INNER t3 aren't generated. All new
    joins are created as LOUTER if the join is nullable.
    """
    if reuse_with_filtered_relation and reuse:
        reuse_aliases = [
            a for a, j in self.alias_map.items() if a in reuse and j.equals(join)
        ]
    else:
        reuse_aliases = [
            a
            for a, j in self.alias_map.items()
            if (reuse is None or a in reuse) and j == join
        ]
    if reuse_aliases:
        if join.table_alias in reuse_aliases:
            reuse_alias = join.table_alias
        else:
            # Reuse the most recent alias of the joined table
            # (a many-to-many relation may be joined multiple times).
            reuse_alias = reuse_aliases[-1]
        self.ref_alias(reuse_alias)
        return reuse_alias

    # No reuse is possible, so we need a new alias.
    alias, _ = self.table_alias(
        join.table_name, create=True, filtered_relation=join.filtered_relation
    )
    if join.join_type:
        if self.alias_map[join.parent_alias].join_type == LOUTER or join.nullable:
            join_type = LOUTER
        else:
            join_type = INNER
        join.join_type = join_type
    join.table_alias = alias
    self.alias_map[alias] = join
    return alias

from django-cte.

millerdev avatar millerdev commented on July 22, 2024

Is that a code snippet from Django? If so, you'd need to take that up with the Django project.

from django-cte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.