Skip to content

[Feature] auto_delete_orphans not support back_populates #738

@CroMarmot

Description

@CroMarmot

auto_delete_orphans seems only support backref, not support back_populates

    auto_delete_orphans(Magnet.tags)
  File "/usr/local/lib/python3.10/site-packages/sqlalchemy_utils/listeners.py", line 246, in auto_delete_orphans
    raise ImproperlyConfigured(
sqlalchemy_utils.exceptions.ImproperlyConfigured: The relationship argument given for auto_delete_orphans needs to have a backref relationship set.

however in 2.0 doc https://docs.sqlalchemy.org/en/20/orm/backref.html says

The relationship.backref considered legacy, and use of relationship.back_populates with explicit relationship() constructs should be preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions