Esempio n. 1
0
    def _polymorphic_join_target(self, cls):
        from sqlalchemy.orm import class_mapper
        from sqlalchemy.sql.expression import FromGrouping

        sel = FromGrouping(class_mapper(Person)._with_polymorphic_selectable.alias(flat=True))
        comp_sel = sel.compile(dialect=default.DefaultDialect())

        return comp_sel.process(sel, asfrom=True).replace("\n", "") + " ON companies.company_id = people_1.company_id"
Esempio n. 2
0
    def _polymorphic_join_target(self, cls):
        from sqlalchemy.orm import class_mapper
        from sqlalchemy.sql.expression import FromGrouping

        sel = FromGrouping(class_mapper(Person)._with_polymorphic_selectable.alias(flat=True))
        comp_sel = sel.compile(dialect=default.DefaultDialect())

        return \
            comp_sel.process(sel, asfrom=True).replace("\n", "") + \
            " ON companies.company_id = people_1.company_id"