Skip to content

Support correct ordering for versions added out of sequence #991

@micmarc

Description

@micmarc

I have historical version data in a proprietary format that I would like to migrate to django-reversion, so that all versions can be seen in a single place in the Admin. However, the older migrated versions always show up out of order. (I am also using django-reversion-compare, which sets history_latest_first to True by default.)

In the screenshot below, the version on top is migrated data, and the version on the bottom was created natively by django-reversion.

Image

As best I can tell, this is because the ordering is being done on Version.id instead of Revision.date_created (the migrated versions will have a higher id value, having been added later). This works fine as long as the revisions and versions are created sequentially, but it breaks when they are not. Is there a particular reason why the sort was implemented this way, or would you be willing to support a date-based sort at least as an option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions