python - sqlalchemy - Could not assemble any primary key columns for mapped table -


i'm using sqlalchemy reflect existing database no foreign keys defined. given following example:

engine = sqlalchemy.create_engine(...) base = declarative_base() base.metadata.reflect(engine)  class a(base):     __table__ = base.metadata.tables['a']   class b(base):     __table__ = base.metadata.tables['b']  class c(base):     __table__ = sqlalchemy.outerjoin(a, b, onclause=a.foo==b.foo) 

how can limit fields used in c?

i tried setting:

__mapper_args__ = {     'include_properties': ['foo', 'bar'] } 

but error

mapper mapper|c|join object on join object on join object on a(47698852085840) , b(47698852088016)(47698861282384) not assemble primary key columns mapped table 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -