cant make a mapper.relation off an alias without specifying primaryjoin/secondaryjoin

Issue #15 resolved
Mike Bayer repo owner created an issue

right now if you try to make a mapper with a relation, and the relation is against an alias, alias has no foreign key accessor so it cant figure out the join conditions.

Comments (1)

  1. Mike Bayer reporter

    this feature has been fixed, you can now use an alias as of changeset changeset:671.

    however, the original reason for this feature, to eager load on the same table twice, doesnt apply as that strategy had a lot of problems. instead, a new 'selectalias' flag used only by eagerloader has been added so that the eagerloader makes an alias just for its select criterion, and converts columns back to the expected name on each incoming row.

    if you totally relate against an alias, assuming the class is also related against its ultimate table or other aliases as well, you get mapper conflicts where commits dont always work on the right relationships, and its just more sketchy than it has to be. making a more local change just within eagerloader's select/result code is a lot safer.

  2. Log in to comment