[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
contract entity: from api.extensions import db from sqlalchemy.sql import expression contracts_users = db.Table("contracts_users", db.Column("contract_id" , db.Integer, db.ForeignKey( "contracts.id"), primary_key=True),

[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
return {"message": "Contract id couldn't be found"}, 404 pass On Thursday, May 28, 2020 at 6:07:05 PM UTC+1, Tanjil Hussain wrote: > > Could you please give me an example. sorry im abit confused and new to > this.. > > On Thursday, May 28, 2020 at 6:02:52 P

[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
Could you please give me an example. sorry im abit confused and new to this.. On Thursday, May 28, 2020 at 6:02:52 PM UTC+1, Tanjil Hussain wrote: > > Hey, what do you mean by this exactly.. sorry im abit confused and new to > this.. > > On Thursday, May 28, 2020 at 5:55:08 PM

[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
Hey, what do you mean by this exactly.. sorry im abit confused and new to this.. On Thursday, May 28, 2020 at 5:55:08 PM UTC+1, Jonathan Vanasco wrote: > > Sorry, I meant the SqlAlchemy schema. I can't attempt to troubleshoot > code that I can't see. > -- SQLAlchemy - The Python SQL Toolkit

[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
permission_contract: [image: Capture.PNG] permissions: [image: Capture2.PNG] contracts: [image: Capture3.PNG] -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and

[sqlalchemy] Re: how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
ave to filter: > > > some_object = > session.query(PermissionEntity).filter(PermissionEntity.permission_id==2, > PermissionEntity.contract_id==2).first() > > > or > > some_object = session.query(PermissionEntity).filter_by(permission_id==2, > contract_id==2).fi

[sqlalchemy] how can i remove an entry from relational database using sqlalchemy in python

2020-05-28 Thread Tanjil Hussain
[image: Capture.PNG] permission_id and contract_id have a relationship in the database How can i using remove a entry for example.. if permission_id = 2 and contract_id = 2 exists in the same entry as shown on line one in database, i want to be able to remove it from my database. (This entry