Are there any plans to handle circular dependencies by using
deferrable foreign key constraints when available?
In my case, I had made the foreign key constraints deferred, but
SQLAlchemy didn't pick up on that when I reflected the database
metadata. I eliminated the circular dependency by using
Right, delete-orphan is what adds the lifecycle relationship between
parent and child. It means that the child can't exist without a
parent. That lets SA know that it should eliminate the child rather
than trying to null out the relationship.
You probably want all so that all actions performed
See http://www.sqlalchemy.org/docs/
datamapping.myt#datamapping_relations_lifecycle
I think you want a parent-child relationship between User and
Userdata. Here's how I would change it (disclaimer: I'm new to SA
myself):
class User(object):
pass
class Userdata(object):
pass ### we'll