extract a little more shared case /longs
This commit is contained in:
+2
-13
@@ -38,6 +38,7 @@ from generic.models import (
|
||||
QuestionBase,
|
||||
QuestionNote,
|
||||
SeriesBase,
|
||||
SeriesImageBase,
|
||||
UserAnswerBase,
|
||||
UserUserGroup,
|
||||
)
|
||||
@@ -351,24 +352,12 @@ def test_image_validator(file):
|
||||
pass
|
||||
|
||||
|
||||
class LongSeriesImage(models.Model):
|
||||
class LongSeriesImage(SeriesImageBase):
|
||||
image = models.FileField(upload_to=image_directory_path)
|
||||
position = models.IntegerField(default=0)
|
||||
upload_filename = models.CharField(max_length=255, blank=True)
|
||||
series = models.ForeignKey(
|
||||
"LongSeries", related_name="images", on_delete=models.SET_NULL, null=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ["position"]
|
||||
|
||||
def get_dicom_info(self):
|
||||
try:
|
||||
info = pretty_print_dicom(pydicom.read_file(self.image))
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
info = "File is not a dicom."
|
||||
return info
|
||||
|
||||
|
||||
@reversion.register
|
||||
class LongSeries(SeriesBase):
|
||||
|
||||
Reference in New Issue
Block a user