.
This commit is contained in:
@@ -285,6 +285,27 @@ class LongSeries(models.Model):
|
||||
"<div>{}<br/>{}<br/>Images: {}</div>", examination, thumb, image_number
|
||||
)
|
||||
|
||||
def order_by_upload_filename(self):
|
||||
images = self.images.all()
|
||||
|
||||
filenames = []
|
||||
map = []
|
||||
|
||||
for i in images:
|
||||
filenames.append((i, i.upload_filename))
|
||||
map[i.upload_filename] = i
|
||||
|
||||
filenames = sorted(filenames)
|
||||
|
||||
n = 1
|
||||
for f in filenames:
|
||||
i = map[f]
|
||||
i.position = n
|
||||
i.save()
|
||||
n = n + 1
|
||||
|
||||
|
||||
|
||||
def order_by_dicom_location(self):
|
||||
images = self.images.all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user