Here, no need to touch Property.get_join(), only a new join_via():

def join_via( keys, mapper):
    clause = None
    c = None
    self_select_table = None
    for key in keys:
        prop = mapper.props[key]
        try:
            c = prop.get_join()         #SA rev<2285
        except TypeError:
            c = prop.get_join( mapper)  #SA rev>=2285
        if prop.mapper is mapper:
            column_equivalents =
                  mapper._get_inherited_column_equivalents()
            parent_select_table = self_select_table
            self_select_table = prop.target.alias()

            c.accept_visitor( sqlalchemy.sql_util.ClauseAdapter(
                self_select_table, 
                include=prop.remote_side,
                equivalents= column_equivalents
            ))
            if parent_select_table:
                c.accept_visitor( sqlalchemy.sql_util.ClauseAdapter(
                    parent_select_table, 
                    include=prop.foreignkey,
                    equivalents= column_equivalents
                ))

        if clause is None:
            clause = c
        else:
            clause &= c
        mapper = prop.mapper
    return clause, mapper, lasttable

### now and_() the condition_column._makeproxy( lasttable) and above 
clause. hmm that should be another ClauseAdapter...

> no, wrong, there's more to it; each level's parent.table should be
> the previous level's aliased table...
>
> > i think i managed to construct a proper thing, changing
> > PropertyLoader.get_join(), and made my own join_via():
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to