Yes i understand that 1 to Many do not link to Field but Record but i need to Reference to a Field which is not id . so with that i can set two primary keys but i want to reference to EmailID (which is not auto increment Integer but a md5sum , string , Unique) .
Is that possible? On Sun, Aug 8, 2010 at 1:36 PM, qqsaqq <sla...@gmx.net> wrote: > as I understand this, the DAL always uses the id field for referencing > in a one to many relationship. And: you don't link to a certain field > (EmailID) but to a record of your emails table. > > see > http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables > > On Aug 8, 8:00 am, Phyo Arkar <phyo.arkarl...@gmail.com> wrote: > > I am Thinking to link two tables , > > "emails" and "attachments" > > > > emails have a unique key , EmailID , which is a md5sum of the path to > email > > file > > > > I am trying to link with another table which is attachment table , it > will > > have a field 'attachment_of' which is link to "EmailID" > > > > To Short > > > > How can i link between primary and foreign keys which is a > > non-id_but_unique field? >