<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 class="gmail_signature"><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>