You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data model changes: there are many ways we could model the opinion "versions". I think that the simplest is adding a field that points to the "main" version
classOpinion(models.Model):
cluster=models.ForeignKey(
OpinionCluster,
help_text="The cluster that the opinion is a part of",
related_name="sub_opinions",
on_delete=models.CASCADE,
)
....
main_version=models.ForeignKey(self, null=True)
This has the advantage of being simple enough, and :
You can find the "main" version via a simple query Opinion.objects.filter(main_version__isnull=True)
Given the "main" version you can find all it's versions Opinion.objects.filter(main_version=main_version_id)
these queries should be covered by an index
The Opinion model already has all the metadata fields for comparing versions: dates, the uploaded document copy, the original URL, the extracted text
all the versions would be grouped under the same OpinionCluster
The text was updated successfully, but these errors were encountered:
From the parent issue
data model changes: there are many ways we could model the opinion "versions". I think that the simplest is adding a field that points to the "main" version
This has the advantage of being simple enough, and :
these queries should be covered by an index
all the versions would be grouped under the same OpinionCluster
The text was updated successfully, but these errors were encountered: