notnonuninvisible
notnonuninvisible

Reputation: 303

Django-imagekit AdminThumbnail: how to display a thumbnail but link to original uploaded file

I'm using django-imagekit in the admin, and I cannot get the listing to display a cached thumbnail but link it to the original file. How do I use original image in link, and a thumbnail in the img src?

Thumbnails are created properly, they are displayed correctly, but when I click on a thumbnail I want to go to the original file, not the thumbnail in media/CACHED/.../...

Upvotes: 0

Views: 165

Answers (1)

notnonuninvisible
notnonuninvisible

Reputation: 303

Ok, Got it. A thumbnail can have the original_file as a "source" attribute. This is read via getattr, and then used in the default template.

So in my case it's i need to:

cached.source = img

in my wrapped func.

Upvotes: 0

Related Questions