[sqlalchemy] Re: Many to many self referential relationship.

2008-02-20 Thread Martin Pengelly-Phillips
Thank you Michael - it's always good to get some validation when pushing your own knowledge of a system. I'll check out the trunk tomorrow, give it a whirl and report any findings then. Thanks again for the quick response, Martin On Feb 20, 6:31 pm, Michael Bayer [EMAIL PROTECTED] wrote: On

[sqlalchemy] Re: Many to many self referential relationship.

2008-02-20 Thread jason kirtland
[EMAIL PROTECTED] wrote: slightly OT... http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/examples/ve rtical/dictlike-polymorphic.py hmmm, figuratively speaking, what u describe above is a sort of single-table-inheritance approach over a single-value classes, one per value-type,

[sqlalchemy] new polymorphic criterion operators (was: Problem with Query)

2008-02-20 Thread Michael Bayer
hey there - in addition to the querying strategies I emailed to you privately, the latest trunk also has a new operator of_type which allows this pattern (as a review, Person joins to Role via the roles relation, Employee is a subclass of Role): session .query (Person ).filter

[sqlalchemy] ordering by number of objects in a many-to-many relationship

2008-02-20 Thread Ryszard Szopa
Hi group, Is there an easy way of ordering objects by the number of objects that stand in a ManyToMany relationship with it? My use case is the following: I have two types of entities, tags and articles, that stand in a ManyToMany relation. I want to order the tags by the number of articles