Setting 0/1-to-1 relationship in SQLAlchemy?

Posted by Timmy on Stack Overflow See other posts from Stack Overflow or by Timmy
Published on 2010-04-23T17:22:29Z Indexed on 2010/04/23 17:23 UTC
Read the original article Hit count: 245

Filed under:
|
|

is there a proper way of setting up a 0/1-to-1 relationship? i want to be able to check if the related item exists without creating it:

if item.relationship is None:
    item.relationship = item2()

but it creates the insert statements on the if statement

© Stack Overflow or respective owner

Related posts about sqlalchemy

Related posts about python