exception documentation

class CircularDependencyError(SQLAlchemyError): (source)

View In Hierarchy

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_message Undocumented

Inherited from HasDescriptionCode (via SQLAlchemyError):

Instance Variable code Undocumented
Method _code_str Undocumented
def __init__(self, message: str, cycles: Any, edges: Any, msg: Optional[str] = None, code: Optional[str] = None): (source)
def __reduce__(self) -> Union[str, Tuple[Any, ...]]: (source)

Undocumented

Undocumented

Undocumented