-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Support customizing the history manager and historical queryset classes #1306
Support customizing the history manager and historical queryset classes #1306
Conversation
f1d2cc3
to
56242d3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1306 +/- ##
=======================================
Coverage 96.87% 96.87%
=======================================
Files 23 23
Lines 1278 1282 +4
Branches 211 211
=======================================
+ Hits 1238 1242 +4
Misses 21 21
Partials 19 19 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good!
I allowed myself to make some small improvements to the documentation you wrote; does it look okay to you?
Guess we could get this in with the 3.5.0 release..
@tim-schilling Just in case you didn't see my comments above :) |
I definitely have. I should get to it this week. Thank you for the review! |
Alright, we can release 3.5.0 in the meantime, then - unless you'd like this included? 🙂 |
Nope, no qualms on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 😊
This allows customizing the history model's
Manager
andQuerySet
classes.Description
To manipulate the History Manager or the Historical QuerySet, you can specify the
history_manager
andhistorical_queryset
options. Tht values must be subclasses ofsimple_history.manager.HistoryManager
andsimple_history.manager.HistoricalQuerySet
respectively.Example:
Related Issue
Closes #1280
Probably closes #963
Motivation and Context
I have a multi-tenant application and I have a custom
QuerySet
class that I wanted to re-use.How Has This Been Tested?
I've tested this with my application, though not in production yet. I also added tests to the test suite that cover the cases adequately.
Screenshots (if appropriate):
Types of changes
Checklist:
pre-commit run
command to format and lint.AUTHORS.rst
CHANGES.rst