[sqlalchemy] Getting Model Name from Query object

2017-03-24 Thread Vijaya Sekar
Hi everyone, I have a 'sqlalchemy.orm.query.Query' object from that how can i know what model it uses from sqlalchemy import create_engine from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import MetaData engine =

[sqlalchemy] Performing filter by using string

2017-03-22 Thread Vijaya Sekar
Hi everyone, I have an string which has the condition to be performed while retrieving from database. I automap my model and make reference to it by using another variable name. How can achieve retrieve data by filter which is in string? here is my code from sqlalchemy import create_engine

Re: [sqlalchemy] automap_base with mapped class

2017-03-11 Thread Vijaya Sekar
Yeah I done it thank u mike -- 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

[sqlalchemy] automap_base with mapped class

2017-03-10 Thread Vijaya Sekar
from sqlalchemy.ext.automap import automap_base from sqlalchemy import create_engine, MetaData lists = ['employees','address'] engine = create_engine("sqlite:///chinook.db") metadata = MetaData() metadata.reflect(engine, only=lists) Base = automap_base(metadata=metadata) Base.prepare() User =

[sqlalchemy] Perfoming join on multiple tables dynamically

2017-03-05 Thread Vijaya Sekar
Hello everyone, I have parent table which holds the primary keys of several child tables.The child table are got as a list . Using SQLalchemy ORM, how can I join multiple child tables to this parent? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper