Browse Source

Sorts revisions of content by identifiers

Adrien Panay 7 years ago
parent
commit
2a3dc6b655
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tracim/tracim/model/data.py

+ 3 - 3
tracim/tracim/model/data.py View File

739
     # The only sorting that makes sens is ordering by "updated" field. But:
739
     # The only sorting that makes sens is ordering by "updated" field. But:
740
     # - its content will soon replace the one of "created",
740
     # - its content will soon replace the one of "created",
741
     # - this "updated" field will then be dropped.
741
     # - this "updated" field will then be dropped.
742
-    # So for now, we order by "updated" explicitly, but remember to switch to
743
-    # "created" once "updated" removed.
742
+    # So for now, we order by "revision_id" explicitly, but remember to switch
743
+    # to "created" once "updated" removed.
744
     # https://github.com/tracim/tracim/issues/336
744
     # https://github.com/tracim/tracim/issues/336
745
     revisions = relationship("ContentRevisionRO",
745
     revisions = relationship("ContentRevisionRO",
746
                              foreign_keys=[ContentRevisionRO.content_id],
746
                              foreign_keys=[ContentRevisionRO.content_id],
747
                              back_populates="node",
747
                              back_populates="node",
748
-                             order_by="ContentRevisionRO.updated")
748
+                             order_by="ContentRevisionRO.revision_id")
749
     children_revisions = relationship("ContentRevisionRO",
749
     children_revisions = relationship("ContentRevisionRO",
750
                                       foreign_keys=[ContentRevisionRO.parent_id],
750
                                       foreign_keys=[ContentRevisionRO.parent_id],
751
                                       back_populates="parent")
751
                                       back_populates="parent")