[sqlalchemy] Re: Adding arbitrary attribute to a model instance during querying

2009-11-11 Thread hb
Thanks a lot for the reply, definitely my code is looking better now. Haldun. --~--~-~--~~~---~--~~ 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 u

[sqlalchemy] Adding arbitrary attribute to a model instance during querying

2009-11-10 Thread hb
Hi all, I have two models: User and Project. The relationship is one-to-many. What I want to achieve is querying users and the number of projects they are connected to. I also want to order the users according to the project counts. The following code seems to work, but the result is a list of (

[sqlalchemy] order by a field of related object

2009-10-06 Thread hb
Hi all, I have a model Project which has a reference to another model Country which has a field named `name`. I want to list projects ordered by the names of the countries. However I didn't achieve. Any thoughts? Haldun. --~--~-~--~~~---~--~~ You received this