kandi X-RAY | Art_Book Summary
kandi X-RAY | Art_Book Summary
Art_Book
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Art_Book
Art_Book Key Features
Art_Book Examples and Code Snippets
Community Discussions
Trending Discussions on Art_Book
QUESTION
I'm stuck on deleting many-to-many records from MySQL db using flask and flask-sqlalchemy. It seems as though sqlalchemy is trying to delete all rows from the relationship table where id of a is the same as linked to the b.
The error(example):
...ANSWER
Answered 2017-Aug-29 at 17:33This is because you've set up two separate relationships for each relationship that you wanted. You have a relationship called Book.authors
and a backref called Author.authors
, as well as a relationship called Author.books
and a backref called Book.books
. This doesn't work because they both operate on the ksiazka_autor
, leading to the conflict that you are seeing. Same goes for all your other relationships.
What you want instead is to use the back_populates
option:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Art_Book
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page