python - How to choose database binds in flask-sqlalchemy -
I have two database binds in the flask - in the 'default' and 'sauce' I model bind_key Used, it worked fine. But now I need to execute that from the 'saas' bind: And I have a 'default' tie, no 'saasu' What should I do? Your , try to reuse your query so that you can change the
class person (db.Model): __tablename__ = 'person' __bind_key__ = 'sus' id = column (integer), primary_key = true) name = column (unicode) person. Queer gate (5)
FLASCAD from SQLLM Exxccamlimi import imported from SQLLM Focci DB = SQLLM (APP) DB.Session.Quree (Majore dodo (some_most)). First () db.session.commit ()
db.session query is not using the person model at all Also, so it does not know anything about
__bind_key___
Person .query.filter (...). First ()
Comments
Post a Comment