python - sqlAlchemy: Select from View -
there existing mysql database contains view lets columns 'vendor', 'product' , 'orderno'.
the view doesn't contain primary key. far know pk important orm. how possible model view in orm sqlalchemy?
if possible execute following query:
select exist( select * _viewname_ 'vendor' = [value1] , 'product' = [value2] , 'orderno' = [value3] );
which should result in...
q = session.query(_viewname_).filter( _viewname_.vendor == [value1], _viewname_.product == [value2], _viewname_.orderno == [value3] ) session.query(q.exists()).scalar()
thanks help.
Comments
Post a Comment