-
-
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
Deleting select historical records #313
Comments
Have you tried |
I'm using this app and, initially, I wanted something more "field-oriented" but now I like to have the full info in each historical record. I'm not sure if there would be a big impact of adding that check (if all I wouldn't mind having that in crontab to cleanup database (instead of doing the check directly) and it would solve also issues like this one. Would that be of interest? EDIT: I was just checking the |
@fopina exactly – we've had this feature request a few times, but checking for dirty fields on save would definitely be a lot slower. I'm open to having a management command that deletes duplicate records that users can run periodically. Feel free to put up a PR for that. |
@fopina @rossmechanic To clean up a dirty model history I ended up building a function like that, but it was quite messy and I'm sure there are better ways to do it. What I've done in the meantime is had programs check for fields worth saving being changed and otherwise use |
Not sure if this is related to the situation raised in #254, but the app had a runaway save problem and created a ton of nearly duplicate historical entries which need to be cleared.
Running a routine that found each of the duplicate historical objects from
Model.history.first().instance
. And then using.delete()
seems to delete the original record rather than the history record.Is it possible to do this through the queryset manager?
The text was updated successfully, but these errors were encountered: