#2527: CircularDependencyError, possible bug in UOW ..?
---------------------------+-----------------------------------------------
Reporter: jcigar | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: orm | Severity: no triage selected yet
Resolution: | Keywords: unit of work, circular dependency
Progress State: awaiting |
triage |
---------------------------+-----------------------------------------------
Comment (by jcigar):
I digged a little bit more, and it seems that the problem is that
''use_alter=True'' *'''must'''* be set on the foreign keys which have
circular dependencies.
I don't know if this should be considered as a bug in the autoload
feature? In other words: Should the autoload feature detects foreign keys
which have circular dependencies and set ''use_alter=True'' on those?
So it works with the following:
{{{
#!python
table_content = schema.Table('content', db_meta,
schema.Column('container_id', types.Integer(),
schema.ForeignKey('folder.content_id', use_alter=True,
name='fk_folder')),
schema.Column('icon_content_id', types.Integer(),
schema.ForeignKey('data.content_id', use_alter=True,
name='fk_data')),
autoload=True,
extend_existing=True,
autoload_replace=True,
autoload_with = db_engine)
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2527#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|