Both methods cause a crash (yes, on 0.4.5) . converting a tuple to a list in sqlalchemy/orm/query.py fixes it for one of the methods, for the other you need to do the opposite, convert a list to a tuple.
File '/home/moshe/top/webapp/rma/rma/controllers/list.py', line 215 in list_sources myquery = myquery.reset_joinpoint().order_by(model.Source.c.popularity) File '/home/moshe/top/webapp/rma/sqlalchemy/util.py', line 198 in starargs_as_list return func(self, *to_list(args[0], []), **kwargs) File '/home/moshe/top/webapp/rma/sqlalchemy/orm/query.py', line 571 in order_by q._order_by = q._order_by + criterion TypeError: can only concatenate list (not "tuple") to list On May 6, 8:45 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On May 6, 2008, at 1:43 PM, Moshe C. wrote: > > > > > Hi, > > > Node is an orm mapped class, which is self-referential. > > > myquery = Node.query() > > myquery = myquery.join('parent', aliased=True) > > myquery = myquery.filter(Node.c.desc.like('%something')) > > myquery = myquery.order_by(Node.c.name) > > > The last line orders by the 'name' of the 2nd joined table. > > > How can I add another order_by (after the one above) that orders by > > some column of the first instance of the table? > > place another order_by() either before the join(), or after calling > reset_joinpoint(). Make sure you're on 0.4.5. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---