[PonyORM-list] Problem with iterated linked table

Pedro Baumann ondoheer at gmail.com
Thu Nov 20 05:43:40 UTC 2014


Hello,

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.

I'm having a small problem with my latest project, I hope you can help me.

I'm developing a web app that has a basic "blog like" module.

Post->Comments->Replies

I'm using Flask as a framework.

I'm passing


*posts = Post.select_by_sql('SELECT * FROM post ORDER BY id')*

to the template, and then iterating through it to print the comments as in

{% for comment in post.comments %}
  {% if loop.index > numberComments %}{% break %}{% endif %}
 // code code code (HTML)
{% endfor %}

the problem is the comments come out in random order, varying on each
iteration.

I need to be able to print the comments in order for my ajax functions that
retrieve more comments to work.

I think I am missing something here.

Thanks !

*Pedro Baumann Cornejo*
Psicólogo - Psicoterapeuta - Flores de Bach
Francisco de Paula Ugarriza 309 dpto. 102 Miraflores.
Lima
Perú
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20141120/aed9e8a6/attachment.html>


More information about the ponyorm-list mailing list