Foreign Keys on Python Flask -


Obtaining this error with the DB model. What can be the problem in any idea?

  Invalid space error: when starting Mapper Mapper. Stand | Stand, expression 'stand.tem_code_name == item_id' failed to detect name ("name 'item_id' is not defined"). If this is a class name, consider adding this relationship; & Lt; class 'app.models.Stand' & gt; The class is defined after both dependent classes. Square stand (db.model): stand_id = db Columns (DB String (10), Primary_Keys = True) Stand_name = DB. Columns (DB String (24), Index = True, Exclusive = True) Item_Code_Name = DB Column (db.String, db.ForeignKey ('item_codes.item_id')) item_codes = db.relationship ('Item_codes', primary join = "stand.item_code_name == item_id") Square Item_codes (db.model): item_id = db Column (db.String (10), primary_keys = true) item_name = db.Column (db.String (100), index = true, exclusive = true) combi = db.Column (db.String (140))   

Mapper should know which model to join against

 < Code> square stand (db.model): stand_id = db Columns (DB String (10), Primary_Keys = True) Stand_name = DB. Columns (db string (24), index = true, unique = true) item_code_name = db Columns (DB String, DB. Phorigki ('Item ID. ITM_ID')) Item_code = DB Relationship ('item code', primarieson = "stand.item_code_name == item_codes.itm_id")   

I also use the field Stand.item_code_id (or with those lines) I recommend calling some). With _name I hope to join it against Item_code.item_name .

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -