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.

  class person (db.Model): __tablename__ = 'person' __bind_key__ = 'sus' id = column (integer), primary_key = true) name = column (unicode) person. Queer gate (5)   

But now I need to execute that from the 'saas' bind:

 FLASCAD from SQLLM Exxccamlimi import imported from SQLLM Focci DB = SQLLM (APP) DB.Session.Quree (Majore dodo (some_most)). First () db.session.commit ()   

And I have a 'default' tie, no 'saasu' What should I do?

Your db.session query is not using the person model at all Also, so it does not know anything about __bind_key___

, try to reuse your query so that you can change the Person .query.filter (...). First ()

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -