In [6]: ClassificationTask.query.update(values={'completed': True})
INFO [sqlalchemy.engine.base.Engine] base.py:679 BEGIN (implicit)
INFO [sqlalchemy.engine.base.Engine] base.py:1140 UPDATE schwartz_task
SET completed=%(completed)s
INFO [sqlalchemy.engine.base.Engine] base.py:1143
session.execute(f"SELECT id,task_type FROM
task_type")
task_id_type_map = dict()
for r in task_type_id_map_res:
task_id_type_map[r[0]] = r[1]
return task_id_type_map
Is this on this right path?
On Monday, November 27, 2017 at 4:50:04 AM UTC+13, Mike Baye
On Tuesday, November 28, 2017 at 4:10:42 AM UTC+13, Simon King wrote:
>
> On Sun, Nov 26, 2017 at 11:19 AM, Mischa S <mis...@jetbridge.com
> > wrote:
> > I want to have a polymorphic table that gets its identity from a column
> in a
> > "type" table
I want to have a polymorphic table that gets its identity from a column in
a "type" table. I have a "task" table and a "task_type" table. I want to be
able to create task subclasses that say something like:
__mapper_args__ = {
'polymorphic_identity': 'do_stuff_task',
}
My post https://groups.google.com/d/topic/sqlalchemy/jSDDH-vsNOg isn't
visible, where did it go?
--
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