On 04/19/2017 07:27 AM, Adrian wrote:
I have this relationship which adds a
`ContributionType.proposed_abstracts` backref that contains only
abstracts not flagged as deleted.
contrib_type = relationship(
'ContributionType', lazy=True, foreign_keys=contrib_type_id,
backref=backref('proposed_abstracts',
primaryjoin='(Abstract.contrib_type_id == ContributionType.id) &
~Abstract.is_deleted', lazy=True)
)
This works perfectly fine but unfortunately a
`session.delete(some_contribution_type)` now does not NULL out the
contrib_type_id of an abstract that
has been flagged as deleted.
can you clarify what "now" means? what's the version that "worked" ?
Is there any way to use different join criteria for deletion cascades
and for just accessing the relationship? Or do I need to hook into the
before_delete
event for this?
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and
Verifiable Example. See http://stackoverflow.com/help/mcve for a full
description.
---
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.