title: web2py - programmatically insert on one-to-many db
body: <p>Goodmorning,
  I've a DB with three tables : </p>
  
  <pre><code>db.define_table('person',
              Field('name', length=100),
              Field('dob', length=10),
              Field('address', 'text', length=255),
              Field('countryname', length=3),
              Field('statename', length=100),
              )
  
  db.define_table('opslist',
              Field('opid', length=10),
              Field('dop', length=10),
              Field('type_operation', length=25),
              )
  
  db.define_table('cardlist',
              Field('opid', db.opslist),
              Field('name', db.person),
              Field('countryname', length=3, required=True),
              Field('statename', length=100, required=True),
              Field('zip', length=5, required=False),
              )
  </code></pre>
  
  <p>I would insert by code, means not using a sqlform or a form, some data into ...
  e.g.: If i have all the values insertable into cardlist table the operation must give me the ability to fill automatically  the  related record (creating new if not present) into the other tables.
  This because it's a relational db with foreign keys ...</p>
  
  <p>Is this possible with web2py using the DAL ? or do i have to write my raw sql command ?</p>
  
  <p>Thank You All</p>