Re: [sqlalchemy] Hybrid property with subquery

2018-09-26 Thread YKdvd
I think that got me to where I have a working hybrid. It looks something like this (I broke it up into multiple statements for debugging): @isLast.expression def isLast(cls): dmsq = aliased(dm, name="dmsq") q = cls.id == select([dmsq.id]).where(dmsq.department_id ==

Re: [sqlalchemy] Hybrid property with subquery

2018-09-25 Thread Mike Bayer
On Mon, Sep 24, 2018 at 12:22 PM YKdvd wrote: > > I have an ORM setup with a "departments_milestones" table ("dm", > DepartmentMilestone objects), with "department_id" and "seqOrder" Fields. > Each department has a few records in this table, ordered within the > department by "seqOrder" (so

[sqlalchemy] Hybrid property with subquery

2018-09-24 Thread YKdvd
I have an ORM setup with a "departments_milestones" table ("dm", DepartmentMilestone objects), with "department_id" and "seqOrder" Fields. Each department has a few records in this table, ordered within the department by "seqOrder" (so seqOrder is not unique). Another object "ShotsStatus"