you need the "secondary" table explicit in a many-to-many join:

Information.mapper.add_property('datas', relation(Data.mapper, rel_table,
        primaryjoin=info_table.c.pk==rel_table.c.info_pk,
        secondaryjoin=rel_table.c.data_pk==data_table.c.pk))



On Apr 23, 2006, at 8:39 AM, Gambit wrote:

Hey All,

I'm trying to reproduce, almost exactly, the many to many relationship in the
docs (search for the 'secondaryjoin' keyword) and am encountering an
ArgumentError:

sqlalchemy.exceptions.ArgumentError: Property 'datas' specified with secondary
   join condition but no secondary argument.

I've attached a working test case to this email, and the debug output. As you'll note, it's virtually identical to the example in the documentation.

Operating environment is:
Windows XP SP2
Cygwin
Python 2.4.3
SQLALchemy 0.1.6 rev 1320
SQLite

Cheers,
-G
<many_to_many_test.log>
<many_to_many_test.py>



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to