On the query of many-to-many tables in flask sqlalchemy

I want to implement the function of , which returns all questions under all tags that the user follows and sorts them in chronological order.

Tag and Question are many-to-many, User and Question are one-to-many, and user and tag are many-to-many

I used db.Table to implement many-to-many directly before, but now I change the association table into a FollowTag model according to the dog book, and I don"t understand join query all the time. How can I achieve this function? Thank you! ?

class FollowTag(db.Model):
    tag_id = db.Column(db.Integer, db.ForeignKey("tag.id"),
                       primary_key=True)
    question_id = db.Column(db.Integer, db.ForeignKey("question.id"),
                            primary_key=True)
    create_time = db.Column(db.DateTime, default=datetime.utcnow)

solved
just use db.Table

  https://github.com/eastossifr...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2258e-339b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2258e-339b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?