Let's say I have a many to many relationship as for example in:

        orm.mapper(self.Person, person_table, properties = {
            'relatives' : orm.relation(self.Person,
secondary=person_relative_table,
 
primaryjoin=person_table.c.id==person_relative_table.c.person_id,
 
secondaryjoin=person_relative_table.c.relative_id==person_table.c.id,
                                     backref='followers'),
            }

Is there an elegant ORM-only expresssion to retrieve all the Persons
that have more than 2 Relatives?

Creating the non-ORM count-join-group by-having expression on the
person_relative_table is easy, but you end up with person ids that you
still have to convert to Person objects.

TIA

Moshe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to