|
|
|
|
735
|
revision_to_serialize = -0 # This flag allow to serialize a given revision if required by the user
|
735
|
revision_to_serialize = -0 # This flag allow to serialize a given revision if required by the user
|
736
|
|
736
|
|
737
|
id = Column(Integer, primary_key=True)
|
737
|
id = Column(Integer, primary_key=True)
|
|
|
738
|
+ # TODO - A.P - 2017-09-05 - revisions default sorting
|
|
|
739
|
+ # The only sorting that makes sens is ordering by "updated" field. But:
|
|
|
740
|
+ # - its content will soon replace the one of "created",
|
|
|
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.
|
|
|
744
|
+ # https://github.com/tracim/tracim/issues/336
|
738
|
revisions = relationship("ContentRevisionRO",
|
745
|
revisions = relationship("ContentRevisionRO",
|
739
|
foreign_keys=[ContentRevisionRO.content_id],
|
746
|
foreign_keys=[ContentRevisionRO.content_id],
|
740
|
- back_populates="node")
|
|
|
|
|
747
|
+ back_populates="node",
|
|
|
748
|
+ order_by="ContentRevisionRO.updated")
|
741
|
children_revisions = relationship("ContentRevisionRO",
|
749
|
children_revisions = relationship("ContentRevisionRO",
|
742
|
foreign_keys=[ContentRevisionRO.parent_id],
|
750
|
foreign_keys=[ContentRevisionRO.parent_id],
|
743
|
back_populates="parent")
|
751
|
back_populates="parent")
|