<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:rgb(61,133,198)">Try using:<br><br><span style="font-family:monospace">'"SELECT * FROM "post" ORDER BY "post"."id"'</span><br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:rgb(61,133,198)">If I were you, I'd do the following in pony:<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:rgb(61,133,198)"><span style="font-family:monospace">Post.select().order_by(Post.id)</span><br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:rgb(61,133,198)">Also, my post on Pony might be worth a look -> <a href="http://nafiulis.me/a-todo-app-with-flask-and-pony.html">http://nafiulis.me/a-todo-app-with-flask-and-pony.html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 11:43 AM, Pedro Baumann <span dir="ltr"><<a href="mailto:ondoheer@gmail.com" target="_blank">ondoheer@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">Hello,<div><br></div><div>first of all I want to thank you for creating such an intuitive and pythonic ORM, I have enjoyed every minute if used it, it's most intuitive and it really heps code readability.</div><div><br></div><div>I'm having a small problem with my latest project, I hope you can help me.</div><div><br></div><div>I'm developing a web app that has a basic "blog like" module.</div><div><br></div><div>Post->Comments->Replies</div><div><br></div><div>I'm using Flask as a framework. </div><div><br></div><div>I'm passing <br clear="all"><div><div><div dir="ltr"><div><b><br></b></div><div><b>posts = Post.select_by_sql('SELECT * FROM post ORDER BY id')<br></b></div><div><b><br></b></div><div>to the template, and then iterating through it to print the comments as in </div><div style="font-weight:bold"><b><br></b></div><div><div style="font-weight:bold">{% for comment in post.comments %}</div><div style="font-weight:bold"> {% if loop.index > numberComments %}{% break %}{% endif %} </div><div style="font-weight:bold"> // code code code (HTML)</div><div style="font-weight:bold">{% endfor %}</div><div style="font-weight:bold"><br></div><div>the problem is the comments come out in random order, varying on each iteration.</div></div><div><br></div><div>I need to be able to print the comments in order for my ajax functions that retrieve more comments to work.</div><div><br></div><div>I think I am missing something here. </div><div><br></div><div>Thanks !</div><div style="font-weight:bold"><b><br></b></div><b>Pedro Baumann Cornejo</b><div>Psicólogo - Psicoterapeuta - Flores de Bach</div><div>Francisco de Paula Ugarriza 309 dpto. 102 Miraflores.</div><div>Lima</div><div>Perú</div></div></div></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><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><font size="4" face="trebuchet ms, sans-serif" color="#6fa8dc">Kind Regards,</font></div><div><img src="https://brnbcg.blu.livefilestore.com/y1mIyqRuYWMVkEp1XgqnpPJw31rRYoNvXRcLpo1WOUfIx-d9b0krZq2EJ4vUjOgoHcfZow1IZifvV3JxEuWl7yinOPYSMwlrPk7rFfWQ7RMTlkgQ9uTAq0uNQ/Signature1.png?psid=1" width="96" height="69"><br></div><div></div><div><span style="font-family:'trebuchet ms',sans-serif;font-size:large"><font color="#6fa8dc">Quazi Nafiul Islam</font></span></div></div></div>
</div>