Re: [sqlalchemy] How to make polymorphic identity condition involving a join not be a subselect

2017-11-27 Thread Mischa S
I tried doing this, it seems to kind of work: class TestTask(Task): """Test task - only for use in tests.""" __tablename__ = None # suuper needed without it polymorphic filter will not work task_type_name = TaskTypeEnum.test_worker_task.value @task def process(self):

Re: [sqlalchemy] How to make polymorphic identity condition involving a join not be a subselect

2017-11-27 Thread Mischa S
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 > wrote: > > 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 >

Re: [sqlalchemy] How to make polymorphic identity condition involving a join not be a subselect

2017-11-27 Thread Simon King
On Sun, Nov 26, 2017 at 11:19 AM, Mischa S wrote: > 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__ = { >

Re: [sqlalchemy] How to make polymorphic identity condition involving a join not be a subselect

2017-11-26 Thread Mike Bayer
On Sun, Nov 26, 2017 at 6:19 AM, Mischa S wrote: > 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__ = { >

[sqlalchemy] How to make polymorphic identity condition involving a join not be a subselect

2017-11-26 Thread Mischa S
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', } (Assuming