Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin history/view for non-admin views (issue #46) #47

Merged
merged 4 commits into from
Sep 22, 2015

Conversation

spapas
Copy link
Contributor

@spapas spapas commented Sep 22, 2015

Changes:

  • Refactor admin.py by extracting common code between admin and non-admin view and putting it to two new modules: mixins.py (for view mixins) and compare.py (for compare objects)
  • Implement a HistoryCompareDetailView CBV that can be used as a normal DetailView to both display the history and select-version-form and the changes of the selected versions
  • Fix tests so that they run under windows and add test for new CBV (by copying the tests for the SimpleModel -- probably this could be refactored a bit)
  • Update README and AUTOHRS

Changes:

* Refactor admin.py by extracting common code between admin and non-admin view and putting it to two new modules: mixins.py (for view mixins) and compare.py (for compare objects)
* Implement a HistoryCompareDetailView CBV that can be used as a normal DetailView to both display the history and select-version-form *and* the changes of the selected versions
* Fix tests so that they run under windows and add test for CBV (by copying the tests for the SimpleModel -- probably this could be refactored a bit)
* Update README and AUTOHRS
@jedie
Copy link
Owner

jedie commented Sep 22, 2015

Thanks for contribution!

Travis tests failed with Python 3: https://travis-ci.org/jedie/django-reversion-compare/jobs/81554176#L298-L300

@spapas
Copy link
Contributor Author

spapas commented Sep 22, 2015

@jedie should be ok now I'd forgot to run the tests with python 3 !


Beyond the admin views, you can also create a class based view for displaying and comparing version
differences. This is a single class-based-view that either dispalys the list of versions to select
for an object or displays both the versions *and* their differences (if the versions to be compared
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to and ;)

@spapas
Copy link
Contributor Author

spapas commented Sep 22, 2015

Everything should be ok now - sorry I wasn't really familiar with creole syntax :(

jedie added a commit that referenced this pull request Sep 22, 2015
Admin history/view for non-admin views (issue #46) - contributed by Papastefanos, Serafeim
@jedie jedie merged commit cebb940 into jedie:master Sep 22, 2015
@jedie
Copy link
Owner

jedie commented Sep 22, 2015

I will check this soon and create a new release. Thanks for contributing!

@jedie
Copy link
Owner

jedie commented Sep 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants