From 55455f327fba4790eb0948421a84cf2e68393eeb Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 21 Jan 2021 19:40:16 +0000 Subject: [PATCH] . --- rapids/tables.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rapids/tables.py b/rapids/tables.py index aa2de77f..306f2627 100755 --- a/rapids/tables.py +++ b/rapids/tables.py @@ -12,11 +12,12 @@ from easy_thumbnails.exceptions import InvalidImageFormatError class ImageColumn(tables.Column): def render(self, value): + image_object = value.first().image try: - thumbnailer = get_thumbnailer(value) + thumbnailer = get_thumbnailer(image_object) return format_html('', thumbnailer["exam-list"]) except InvalidImageFormatError: - return format_html('Invalid image url', value) + return format_html('Invalid image url', image_object) class RapidTable(tables.Table): @@ -32,11 +33,11 @@ class RapidTable(tables.Table): text='Clone', args=[A('pk')], orderable=False) - image = ImageColumn("image", orderable=False) + images = ImageColumn("images", orderable=False) class Meta: model = Rapid template_name = "django_tables2/bootstrap4.html" fields = ("normal", "abnormality", "region", "examination", "laterality", "site", "created_date", "author") - sequence = ("view", "image") \ No newline at end of file + sequence = ("view", "images") \ No newline at end of file