<div dir="ltr">Looks like you didn't import the desc() function. You can import it either this way:<div><br></div><div>� � from pony.orm import *</div><div><br></div><div>or this way:</div><div><br></div><div>� � from pony.orm import desc</div>
<div><br></div><div>The first way will import all the necessary functions for working with Pony ORM, whereas with the second approach you can choose what you import and what not. Also, if you don't want to import Pony functions into your global name space you can do this:</div>
<div><br></div><div>� � from pony import orm</div><div><br></div><div>In this case you can access the desc() function via the orm module:</div><div><br></div><div>� ��<span style="font-size:13px;font-family:arial,sans-serif">transactions = Transaction.select().order_by(orm.</span><span style="font-size:13px;font-family:arial,sans-serif">desc(Transaction.created))[:]</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">Let me know if it worked for you.</span></div><div><span style="font-size:13px;font-family:arial,sans-serif">Thanks,</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif">Alexey</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 17, 2013 at 8:34 PM, Guy Jacks <span dir="ltr"><<a href="mailto:guy.jacks@gmail.com" target="_blank">guy.jacks@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">transactions = Transaction.select().order_by(desc(Transaction.created))[:]<br><br>This works without the desc() method but it fails after I wrap Transaction.created in desc().<br>
<br>The documentation states that the following should work:<br>
<br>for p in Product.select(lambda p: p.price > 100).order_by(desc(Product.price))<div><br></div><div><div>Thanks in advance for any pointers.</div></div></div>
<br>_______________________________________________<br>
ponyorm-list mailing list<br>
<a href="mailto:ponyorm-list@ponyorm.org">ponyorm-list@ponyorm.org</a><br>
<a href="/ponyorm-list" target="_blank">/ponyorm-list</a><br>
<br></blockquote></div><br></div>