.
This commit is contained in:
+4
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user