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 is unique so can only appear once)
I have tried PermissionEntity.query.get(contract_id) and PermissionEntity.query.get(permission_id)
but doesnt seem to be working as Its not stored in a permission entity.. My relationship does not have an entity. the table i have provided a picture for has a relationship with permissions table and contracts table..
some_object = session.query(VersionedFoo).get((5, 10))
my_object = query.get((5, 10))
some_object = session.query(PermissionEntity).filter(PermissionEntity.permission_id==2, PermissionEntity.contract_id==2).first()
some_object = session.query(PermissionEntity).filter_by(permission_id==2, contract_id==2).first()
this table does not have any entities but has foreign keys which gets data from the two table mentioned above...
What I am trying to do is send a query to this table and delete an entry if it exists and i am doing this by the following:
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/aac681c3-1a8f-4f99-9d0c-31ab8350518e%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlal...@googlegroups.com.