I just set up my own forum, and am attempting to sort a user's subscriptions by the last post in each thread(BBTopic). However the sorted function is failing saying lambda only takes 1 argument but was given 2. I use this sorted function on lists of non SQLObject objects and it works fine for me.
Can you use sorted with a list returned from a select? Or is there a way for me to rewrite this? Perhaps using orderBy? subs_sel = list(BBSubs.select(BBSubs.q.user_id==1)) for sub in subs_sel: sub.topic = BBTopic.get(sub.topic_id) sub.post = BBPost.get(sub.topic.last_post_id) sub.forum = BBForum.get(sub.topic.forum_id) subs = sorted(subs_sel, lambda x: x.topic.last_post_id) ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss