Order forum threads in reverse chronological order by creation date.
This commit is contained in:
parent
bce99c26bc
commit
3e51057d2d
|
@ -108,7 +108,6 @@ class Forum( object ):
|
|||
if anonymous is None:
|
||||
raise Access_error()
|
||||
|
||||
# TODO: this needs to sort by either thread/note creation or modification date
|
||||
threads = self.__database.select_many(
|
||||
Notebook,
|
||||
anonymous.sql_load_notebooks(
|
||||
|
@ -116,6 +115,9 @@ class Forum( object ):
|
|||
)
|
||||
)
|
||||
|
||||
# put threads in reverse chronological order by creation date
|
||||
threads.reverse()
|
||||
|
||||
# if there are no matching threads, then this forum doesn't exist
|
||||
if len( threads ) == 0:
|
||||
raise cherrypy.NotFound
|
||||
|
|
|
@ -182,7 +182,7 @@ class User( Persistent ):
|
|||
where
|
||||
user_notebook.user_id = %s%s%s%s%s%s and
|
||||
user_notebook.notebook_id = notebook_current.id
|
||||
order by user_notebook.rank;
|
||||
order by user_notebook.rank, notebook_current.revision;
|
||||
""" % ( tag_tables, quote( self.object_id ), parents_only_clause, undeleted_only_clause,
|
||||
read_write_clause, tag_clause, notebook_id_clause )
|
||||
|
||||
|
|
Reference in New Issue