rmenon
unread,Jan 5, 2012, 1:43:35 PM1/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-mptt-dev
I am trying to create a threaded "commenting" system using django-
mptt .
If we assume that this is for a blog post, then for each blog post, I
want the following to happen
1. Each new comment on the blog post itself is shown first
2. Within each comment thread, the data is sorted based on creation
ts.
The generated query right now is:
SELECT `comment`.`id`, `comment`.`thread_id`, `comment`.`created_by`,
`comment`.`created_by_name`, `comment`.`comment_text`,
`comment`.`creation_ts`, `comment`.`parent_id`, `comment`.`lft`,
`comment`.`rght`, `comment`.`tree_id`, `comment`.`level` FROM
`comment` WHERE `comment`.`thread_id` = 1 ORDER BY `comment`.`tree_id`
ASC, `comment`.`lft` ASC
How do I change it so that we sort by "tree_id" DESC instead of
tree_id ASC which should take care of my requirements?