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

get_field_info broken on a ProcessedImageField #499

Open
tyrylu opened this issue Apr 6, 2020 · 2 comments
Open

get_field_info broken on a ProcessedImageField #499

tyrylu opened this issue Apr 6, 2020 · 2 comments

Comments

@tyrylu
Copy link

tyrylu commented Apr 6, 2020

At least in 4.0.2 imagekit.utils.get_field_info fails to get the instance in a spec associated with a ProcessedImageField. It worked in the past (not sure exactly with which version, unfortunately). Or, is there a different way how to access the current model instance from the associated spec?

@vstoykov
Copy link
Collaborator

vstoykov commented Apr 8, 2020

Can you give more details (code sample) which can be used to reproduce the issue?

@tyrylu
Copy link
Author

tyrylu commented Apr 8, 2020

Nothing really fancy, basically just a modified version of the 3.x advanced docs example. In a model:
image = ProcessedImageField(verbose_name=_("image"), default=NO_IMAGE_PATH, upload_to="productimages", autoconvert=None, spec=OptionalWatermarkSpec)
And in the spec:

@property
    def processors(self):
        instance, field_name = get_field_info(self.source)

And get_field_info is the one from imagekit.utils.
However, instance is None under Imagekit 4.0.2 and Django 3.0.4.

bulatshafigullin added a commit to bulatshafigullin/django-imagekit that referenced this issue Jan 11, 2023
bulatshafigullin added a commit to bulatshafigullin/django-imagekit that referenced this issue Jan 11, 2023
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

No branches or pull requests

2 participants