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

2020-05-29 Thread Mo Hus
[image: Capture.PNG] In regards to your question..I want to remove the whole relationship for example.. the whole first row as shown in the picture: On Friday, May 29, 2020 at 10:21:44 PM UTC+1, Mo Hus wrote: > > Hey Simon , permissions has only relationship with permission_contract and >

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

2020-05-29 Thread Mo Hus
Hey Simon , permissions has only relationship with permission_contract and contract only has relationship with permission_contract ...I want to be able to delete the relationship from permission_contract ... For example, in my permissions_contract, I may have permission_id = 1 which is the id

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

2020-05-29 Thread Simon King
It looks like you've got a many-to-many relationship between Contract and Permission, and you want to remove a Permission from a Contract (or vice versa). Is that right? If so, you can do something like this: contract = permission = contract.permissions.remove(permission)

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

2020-05-29 Thread Mo Hus
Hey Jonathan, any luck? thanks On Thursday, May 28, 2020 at 4:15:38 PM UTC+1, Mo Hus wrote: > > [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