I don't want to use any product to manage my comments I use basic feature So, the older comment is displayed in first (and of course the last at the bottom) what i have to do to have contrary in Plone 4.0.4 ? (the last comment at the top of the comments)
Thanks开发者_Python百科 for your advice
Comments order is managed in plone.app.layout.viewlets.comment
:
http://dev.plone.org/plone/browser/plone.app.layout/trunk/plone/app/layout/viewlets/comments.py#L28
If you want to re-sort the comments you should override or change the original behavior of getRs
method. The final implementation depends on what do you want to do with replies to last comment.
Do you want replies to be also re-sorted? If so, I think that just changing the sort function should work:
rs.sort(lambda x, y: cmp(y.modified(), x.modified()))
Do you want replies to keep original sort? In that case, you should code a little more.
精彩评论