On Fri, Apr 14, 2006 at 06:23:54PM -0700, Steve Quezadas wrote:
> class TableB(SQLObject):
>         VarC = StringCol()
>         VarD = ForeignKey("TableA")
> 
> TableB.createTable()
> 
> InsertTwo = TableB(VarC=200, VarD=InsertOne.id)
> 
> I want it so that if I enter info into TableA, there must also be a
> corresponding record in TableB. I would imagine that the value of the
> foreign key should automatically be put in whatever values the primary
> key is in TableA. Theoretically, I can put anything in VarD

   What do you want to have here? If you want the DB tests if the .id is
really an id from the table A verify that SQLObject created table B with
all necessary declarations related to referential integrity, FOREIGN KEY in
this case. I don't remember if SQLObject 0.7 does that - I use the latest
SQLObject from 0.7.1 branch.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to