On Fri, Mar 8, 2019 at 3:05 PM Conferency wrote:
>
> Thanks.
>
> I didn't use association proxy.
>
> > "because you can't add Tool to Person.tools". This is real code and I can
> > directly append the tool instance.
that will cause this error:
sqlalchemy.orm.exc.FlushError: Attempting to flush
Thanks.
I didn't use association proxy.
> "because you can't add Tool to Person.tools". This is real code and I can
directly append the tool instance.
class Association(db.Model):
...
id = db.Column(Integer, primary_key=True, index=True)
tool_id = db.Column(Integer, ForeignKey('tool
On Thu, Mar 7, 2019 at 4:46 PM Conferency wrote:
>
> Hi, I have 3 classes: two have many to many relationship between them, one is
> association class.
>
> class Person:
> ...
> tools = relationship('Association', back_populates='user', lazy=True,
> cascade='all, delete-orphan')
>
> clas
Hi, I have 3 classes: two have many to many relationship between them, one
is association class.
class Person:
...
tools = relationship('Association', back_populates='user', lazy=True,
cascade='all, delete-orphan')
class Tool:
...
users = relationship('Association', back_populate