Re: [sqlalchemy] Self-Referential Association Relationship SQLalchemy

2014-09-23 Thread Michael Bayer
to_contacts = db.relationship('Contact', secondary='contactrelation', primaryjoin='id== ContactRelation.from_contact_id', secondaryjoin='id== ContactRelation.to_contact_id', or to_contacts = db.relationship('Contact', secondary=contactrelation,

Re: [sqlalchemy] Self-Referential Association Relationship SQLalchemy

2014-09-23 Thread Mohammad Reza Kamalifard
Using contactrelation.from_contact_id ? I have AttributeError: 'Table' object has no attribute 'from_contact_id' Error. On Tue, Sep 23, 2014 at 4:48 PM, Michael Bayer wrote: > > table name, not class name, please see http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/declarative.html#declarativ

Re: [sqlalchemy] Self-Referential Association Relationship SQLalchemy

2014-09-23 Thread Michael Bayer
table name, not class name, please see http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/declarative.html#declarative-many-to-many On Sep 23, 2014, at 8:33 AM, Mohammad Reza Kamalifard wrote: > In my application with SQLAlchemy i need to create many to many relationship > between two cont

[sqlalchemy] Self-Referential Association Relationship SQLalchemy

2014-09-23 Thread Mohammad Reza Kamalifard
In my application with SQLAlchemy i need to create many to many relationship between two contact object also sotre data for each of relatioship here is my Contact model class Contact(db.Model): __tablename__ = 'contact' id = db.Column(db.Integer, primary_key=True) name = db.Column(

Re: [sqlalchemy] Sending queue messages/emails after model commit

2014-09-23 Thread Alex Michael
Hey Jason, Thanks for your reply. That makes sense I guess. It just feels like this is something most webapps will need at some point and it's not as straightforward as someone would imagine. -- alex On Monday, September 22, 2014 6:22:14 PM UTC+2, jason kirtland wrote: > > Hi Alex, > > I have