This commit is contained in:
Ross
2022-05-25 16:50:18 +01:00
parent 41a09ea30d
commit 5701c8d613
30 changed files with 402 additions and 226 deletions
+4 -4
View File
@@ -12,12 +12,12 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
class ImageColumn(tables.Column):
def render(self, value):
obj = value.first()
obj = value.all()
if obj is None:
if not obj:
return format_html('<span>No image<span>')
image_object = obj.image
image_object = obj[0].image
try:
thumbnailer = get_thumbnailer(image_object)
return format_html('<img src="/media/{}" />', thumbnailer["exam-list"])
@@ -60,7 +60,7 @@ class RapidTable(tables.Table):
def __init__(self, data=None, *args, **kwargs):
super().__init__(
data.prefetch_related(
"abnormality", "region", "examination", "images", "exams", "author"
"abnormality", "region", "examination", "images", "exams", "author"
),
*args,
**kwargs,