class CircularDependencyError(SQLAlchemyError): (source)
Raised by topological sorts when a circular dependency is detected. There are two scenarios where this error occurs: * In a Session flush operation, if two objects are mutually dependent on each other, they can not be inserted or deleted via INSERT or DELETE statements alone; an UPDATE will be needed to post-associate or pre-deassociate one of the foreign key constrained values. The ``post_update`` flag described at :ref:`post_update` can resolve this cycle. * In a :attr:`_schema.MetaData.sorted_tables` operation, two :class:`_schema.ForeignKey` or :class:`_schema.ForeignKeyConstraint` objects mutually refer to each other. Apply the ``use_alter=True`` flag to one or both, see :ref:`use_alter`.
Method | __init__ |
Undocumented |
Method | __reduce__ |
Undocumented |
Instance Variable | cycles |
Undocumented |
Instance Variable | edges |
Undocumented |
Inherited from SQLAlchemyError
:
Method | __str__ |
Undocumented |
Method | _message |
Undocumented |
Method | _sql |
Undocumented |
Inherited from HasDescriptionCode
(via SQLAlchemyError
):
Instance Variable | code |
Undocumented |
Method | _code |
Undocumented |