furher shorts improvements

This commit is contained in:
Ross
2025-04-07 11:34:10 +01:00
parent afa1379ce4
commit d387e32777
16 changed files with 795 additions and 111 deletions
+29 -1
View File
@@ -1963,4 +1963,32 @@ class CimarSeriesThumbnail(models.Model):
image = models.ImageField(upload_to="cimar_series_thumbnails")
def __str__(self):
return f"{self.series_id}"
return f"{self.series_id}"
class FindingBase(models.Model):
description = models.TextField(
null=True, blank=True, help_text="Findings on the question"
)
annotation_json = models.TextField(null=True, blank=True)
viewport_json = models.TextField(null=True, blank=True)
# This has been migrated to install the image id (not index)
current_image_id_index = models.TextField(null=True, blank=True)
# TODO add tags
# tags = models.ManyToManyField(Tag, blank=True)
class Meta:
abstract = True
def __str__(self):
return self.description
def annotation_as_string(self) -> str:
return json.dumps(self.annotation_json)
def get_pretty_annotation_json(self):
return get_pretty_json(json.loads(self.annotation_json))
def get_pretty_viewport_json(self):
return get_pretty_json(json.loads(self.viewport_json))