This one time, at band camp, Jonathan Ellis wrote:
>Looks like sqlite is allergic to the sql generated; works fine in postgres
>
>[for test/orm/mapper.py again]
> def testjoin3tables(self):
> class Joined(object):
> pass
> j = join(users, join(orders, orderitems), isouter=True)
> m = mapper(Joined, j, allow_null_pks=True)
> q = create_session().query(m)
> q.select()
I have a 3 way join in a mapper that looks like this:
mapper(Registration, join(account, person).join(registration),
properties = dict(account_id = [account.c.id, person.c.account_id,
registration.c.account_id],
submissions = relation(Submission, lazy=True),
_url_hash = registration.c.url_hash,
)
)
so you could change your join to something like:
j = join(orders, orderitems).join(users)
though, perhaps it's the lack of primary keys that is doing you in?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users