I have a primary model with a "before_update" event and a secondary model
with a foreign key to the primary model. When I create a secondary model,
the primary model's "before_update" event is triggered. I believe this is
because the backref is being updated. Can I prevent this behavior?
id = Column(Integer)
def example(m, c, t):
print("I was triggered by a mapper update!")
primary_id = Column(ForeignKey)
primary = orm.relationship('Primary', backref='secondaries')
s = Secondary(primary_id=1)
>>> I was triggered by a mapper update!
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.