Created
February 15, 2012 15:47
-
-
Save gabbork/1836792 to your computer and use it in GitHub Desktop.
AttributeError using inheritance with 2 ImageSpec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseImage(models.Model): | |
original_image = ProcessedImageField(null = True, blank = True, upload_to='static/original',) | |
admin_thumbnail = ImageSpec([Adjust(contrast=1.2, sharpness=1.1), | |
resize.Crop(50, 50)], image_field='original_image', options={'quality': 90}) | |
def __unicode__(self): | |
return u"%s" % (self.original_image) | |
class Meta: | |
abstract = True | |
class FirstTest(BaseImage): | |
image_first = ImageSpec([Adjust(contrast=1.2, sharpness=1.1), resize.Crop(200, 200)], image_field='original_image', options={'quality': 90}) | |
class SecondTest(BaseImage): | |
image_second = ImageSpec([Adjust(contrast=1.2, sharpness=1.1), resize.Crop(400, 400)], image_field='original_image', options={'quality': 90}) | |
The error tryng to add a 'Second Test': | |
Django Version: 1.3.1 | |
Exception Type: AttributeError | |
Exception Value: 'SecondTest' object has no attribute 'image_first' | |
Exception Location: ...../testimagekit/imagekit/utils.py in get_spec_files, line 33 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment