diff --git a/setup.py b/setup.py index 4dc2f84..ec6fe9d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages setup(name="django-sorl-cropping", - version="0.1.0", + version="0.1.1", description="A reusable app for cropping images easily and non-destructively in Django", long_description=open('README.rst').read(), author="Ilya Chistyakov", diff --git a/sorl_cropping/widgets.py b/sorl_cropping/widgets.py index 57e5185..fbb8765 100644 --- a/sorl_cropping/widgets.py +++ b/sorl_cropping/widgets.py @@ -49,23 +49,23 @@ class Media: class ImageCropWidget(AdminFileWidget, CropWidget): - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): if not attrs: attrs = {} if value: attrs.update(get_attrs(value, name)) - return super(AdminFileWidget, self).render(name, value, attrs) + return super(AdminFileWidget, self).render(name, value, attrs, renderer) class HiddenImageCropWidget(ImageCropWidget): - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): if not attrs: attrs = {} # we need to hide it the whole field by JS because the admin # doesn't yet support hidden fields: # https://code.djangoproject.com/ticket/11277 attrs['data-hide-field'] = True - return super(HiddenImageCropWidget, self).render(name, value, attrs) + return super(HiddenImageCropWidget, self).render(name, value, attrs, renderer) class CropForeignKeyWidget(ForeignKeyRawIdWidget, CropWidget): @@ -85,7 +85,7 @@ def __init__(self, *args, **kwargs): super(CropForeignKeyWidget, self).__init__(*args, **kwargs) - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): if attrs is None: attrs = {} @@ -104,4 +104,4 @@ def render(self, name, value, attrs=None): except AttributeError: logger.error("Object %s.%s doesn't have an attribute named '%s'." % ( app_name, model_name, self.field_name)) - return super(CropForeignKeyWidget, self).render(name, value, attrs) + return super(CropForeignKeyWidget, self).render(name, value, attrs, renderer)