[sqlalchemy] Re: Specifying descending order_by on a backref
On Tue, Feb 17, 2009 at 5:03 PM, Ken kkin...@gmail.com wrote: I'm using the declarative extension. When I specify a backref on a relation, I see the order_by argument and I'm pointing it to the column object. That works, but I need to sort the backref descendingly, not ascendingly. I don't see an option for that in the Relation()/backref() arguments. What am I missing? backref supports the same arguments as relation(), which include an order_by argument. http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html?highlight=backref#sqlalchemy.orm.relation -- Michael Trier http://blog.michaeltrier.com/ http://thisweekindjango.com/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Specifying descending order_by on a backref
On Feb 17, 3:13 pm, Michael Trier mtr...@gmail.com wrote: backref supports the same arguments as relation(), which include an order_by argument. http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html?highligh... Michael, I'm using the order_by argument. The problem is that it's sorting my values ascendingly instead of descendingly. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Specifying descending order_by on a backref
Hi, On Tue, Feb 17, 2009 at 5:22 PM, Ken kkin...@gmail.com wrote: On Feb 17, 3:13 pm, Michael Trier mtr...@gmail.com wrote: backref supports the same arguments as relation(), which include an order_by argument. http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html?highligh... Michael, I'm using the order_by argument. The problem is that it's sorting my values ascendingly instead of descendingly. Sorry, I misunderstood. You should be able to do a order_by=field.desc(). -- Michael Trier http://blog.michaeltrier.com/ http://thisweekindjango.com/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Specifying descending order_by on a backref
On Feb 17, 3:29 pm, Michael Trier mtr...@gmail.com wrote: Sorry, I misunderstood. You should be able to do a order_by=field.desc(). Ah, that answers my question. Thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---