Add a small (125x125px) square thumbnail

This is going to be used by a "similar images" feature #74
This commit is contained in:
Krzysztof Klimonda
2013-03-02 11:55:02 -08:00
parent e70d9079ec
commit a0e11a949e
3 changed files with 42 additions and 3 deletions

View File

@@ -41,6 +41,8 @@ class ImageResource(ModelResource):
attribute=lambda bundle: filter_generator_for('standard')(bundle))
thumbnail = fields.ToOneField(ThumbnailResource, full=True,
attribute=lambda bundle: filter_generator_for('thumbnail')(bundle))
square = fields.ToOneField(ThumbnailResource, full=True,
attribute=lambda bundle: filter_generator_for('square')(bundle))
class Meta:
fields = ['image', 'width', 'height']