changeset 2639:f3e039e4dc49 beta

Added created_on column to changeset comments for proper ordering.
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 20 Jul 2012 20:25:33 +0200
parents 8e6cf847d9d8
children 29dfc6581458
files rhodecode/model/comment.py rhodecode/model/db.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/comment.py	Fri Jul 20 19:59:45 2012 +0200
+++ b/rhodecode/model/comment.py	Fri Jul 20 20:25:33 2012 +0200
@@ -198,6 +198,7 @@
             q = q.filter(ChangesetComment.pull_request == pull_request)
         else:
             raise Exception('Please specify revision or pull_request')
+        q = q.order_by(ChangesetComment.created_on)
         return q.all()
 
     def get_inline_comments(self, repo_id, revision=None, pull_request=None):
--- a/rhodecode/model/db.py	Fri Jul 20 19:59:45 2012 +0200
+++ b/rhodecode/model/db.py	Fri Jul 20 20:25:33 2012 +0200
@@ -1427,7 +1427,8 @@
     f_path = Column('f_path', Unicode(1000), nullable=True)
     user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), nullable=False)
     text = Column('text', Unicode(25000), nullable=False)
-    modified_at = Column('modified_at', DateTime(), nullable=False, default=datetime.datetime.now)
+    created_on = Column('created_on', DateTime(timezone=False), nullable=False, default=datetime.datetime.now)
+    modified_at = Column('modified_at', DateTime(timezone=False), nullable=False, default=datetime.datetime.now)
 
     author = relationship('User', lazy='joined')
     repo = relationship('Repository')