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,
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
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
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(
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