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

Fixed bug that prevented next_record and prev_record from using custo… #501

Merged
merged 2 commits into from
Dec 12, 2018

Conversation

rossmechanic
Copy link
Collaborator

…m manager names

Description

The manager name history had been hardcoded in the function calls for get_next_record and get_prev_record. This PR uses utils.get_history_manager_for_model to allow these functions to be used with custom manager names.

Related Issue

Fixes #500

Motivation and Context

Bug fix.

How Has This Been Tested?

Added tests for next_record and prev_record on a model with custom manager name

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run the make format command to format my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or github handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

@codecov-io
Copy link

codecov-io commented Dec 12, 2018

Codecov Report

Merging #501 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
+ Coverage   97.22%   97.23%   +0.01%     
==========================================
  Files          16       16              
  Lines         721      724       +3     
  Branches       95       95              
==========================================
+ Hits          701      704       +3     
  Misses         10       10              
  Partials       10       10
Impacted Files Coverage Δ
simple_history/models.py 99.22% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5863d95...fa2f6f9. Read the comment docs.

self.poll.save()

def test_get_prev_record(self):

Copy link
Collaborator

Choose a reason for hiding this comment

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

Black didn't delete this empty line?

@rossmechanic rossmechanic merged commit 9203349 into master Dec 12, 2018
@rossmechanic rossmechanic deleted the GH-500-custom-manager-name-on-prev-next-record branch December 12, 2018 15:43
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.

Can't use .prev_record and .next_record when using not default field name
3 participants