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

Link data import objects with Measurements and Reports #384

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dalonsoa
Copy link
Collaborator

@dalonsoa dalonsoa commented Oct 8, 2024

This PR links the DataImport objects with the actual Measurement entries they generate and, to some extent, to the associated Report objects obtained after validation. This way, when a DataImport object is deleted or re-processed, the related data can be easily found and removed (automatically, as they have a CASCADE relation).

I've kept the deletion step based on time range, as some data - specially initial data or that migrated from the current system - will not have an associated DataImport object. Also, the deletion of the Report objects is not accurate as reports might combine data from multiple DataImports, and not being deleted if the wrong DataImport, based on the mode of the data used for the calculation, is associated with that entry. So, again, the deletion based on the time range comes handy.

Close #338

Copy link
Contributor

@Sahil590 Sahil590 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Link data import object with data via ForeignKey with a cascade relation when deleting the former
2 participants