Karl Guertin wrote: > I read somewhere that sqlalchemy can handle mapping onto tables > without primary keys but the options for updating the tables are > limited. While looking through the docs I didn't see a specific > example of how to handle this situation. I did run across the example > in datamapping association[1] and it implies that I can just set the > pk as the union of the first three fields in the above example. Is > this the correct approach, or is there a better way?
that is the approach you probably want to use, i.e. m = mapper(myclass, table, primary_key=[table.c.asn, table.c.type]) Which just tells the mapper what cols make up the primary key. You also can just define a Table object and mark those columns as "primary_key", which will have the same effect (i.e. Table metadata that is not 100% the same as the reality in the DB). ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Sqlalchemy-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

