mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-08 07:30:57 +00:00
Bound fields are now cached on the model instance.
ImageSpecFile and AdminThumbnailView are created on the first access, and then assigned as properties of the model instance for subsequent access.
This commit is contained in:
parent
f570bd0d7f
commit
c00ea10b0a
1 changed files with 4 additions and 2 deletions
|
|
@ -263,8 +263,10 @@ class _ImageSpecDescriptor(object):
|
|||
if instance is None:
|
||||
return self.field
|
||||
else:
|
||||
return ImageSpecFile(instance, self.field, self.attname,
|
||||
self._get_image_field_file(instance))
|
||||
img_spec_file = ImageSpecFile(instance, self.field,
|
||||
self.attname, self._get_image_field_file(instance))
|
||||
setattr(instance, self.attname, img_spec_file)
|
||||
return img_spec_file
|
||||
|
||||
|
||||
def _post_save_handler(sender, instance=None, created=False, raw=False, **kwargs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue