Hey Sandro, IIRC, the primary_key parameter tells the mapping engine which specific columns compose the primary key for that map. This is used in the identity map to identify already-fetched objects, create relations, and so forth while ensuring there aren't any duplicates involved (i.e. two separate objects both with the same primary key value). You need to specify it in a join condition because, as might be one way to think about it, you're creating a new view into a set of data, and the old specified primary keys may no longer be sufficient.
Think of it in the same vein as specifying the PrimaryKey for a column in a Table() definition, but this time for an arbitrary set of columns in a result set. HTH, -G On Thursday, May 11, 2006, 12:40:51 PM, you wrote: > Hi all, > I don't really understand which is the role of the 'primary_key' parameter > to > mapper, particularly when the mapper is built from a join, not a table. > Thanks > sandro > *:-) ------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

