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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -