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