Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminThumbnail: Use source from generator if image_field is a function #577

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

autoantwort
Copy link
Contributor

My main motivation was this example from the readme: https://github.com/matthewwithanm/django-imagekit?tab=readme-ov-file#admin (To use specs defined outside of models:)

If you use this example code and click on the thumbnail image in the admin interface, the thumbnail image will open and not the original image. With this PR the original image will be opened.

@autoantwort
Copy link
Contributor Author

Hm maybe a better approach is to extend the example by adding the following file in cached_admin_thumb before the return:

setattr(cached, 'source', instance.image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant