Re: [sqlalchemy] Custom Flush

2015-06-15 Thread Richard Collins
Thanks Michael. before_flush looks like the way to go. From what I can see so far, it will alleviate the need to call my add_or_remove function, increasing reliability. On Monday, 15 June 2015 10:27:06 UTC+12, Michael Bayer wrote: On 6/14/15 5:49 PM, Richard Collins wrote: I have an

[sqlalchemy] Custom Flush

2015-06-14 Thread Richard Collins
I have an association object: class FolderUserAccess(db.Model): __tablename__ = folderuseraccess folder_id = db.Column(db.Integer, db.ForeignKey('node.id'), primary_key=True) folder = db.relationship('Folder', back_populates='access') user_id = db.Column(db.Integer,

Re: [sqlalchemy] Custom Flush

2015-06-14 Thread Mike Bayer
On 6/14/15 5:49 PM, Richard Collins wrote: I have an association object: class FolderUserAccess(db.Model): __tablename__ = folderuseraccess folder_id = db.Column(db.Integer, db.ForeignKey('node.id'), primary_key=True) folder = db.relationship('Folder', back_populates='access')