With Django 1.7 + there is a 'deconstruct' method that does the same thing, so for ImageWithThumbsField it should be:
def deconstruct(self):
name, path, args, kwargs = super(ImageWithThumbsField, self).deconstruct()
# Only include kwarg if it's not the default
if self.sizes is not None:
kwargs['sizes'] = self.sizes
return name, path, args, kwargs
We should remove old 'south' code that is now unnecessary and add deconstruct method. After deconstruct method is defined there is a need to generate new migrations for all models using ImageWithThumbsField.
I'm not really sure if having 'sizes' in migrations changes anything but for the sake of clarity I think it should be added with deconstruct method. Thoughts?
LFS uses custom ImageWithThumbsField. This fields adds 'sizes' attribute that was referenced by south migrations: https://github.com/diefenbach/django-lfs/blob/master/lfs/core/fields/thumbs.py#L157
With Django 1.7 + there is a 'deconstruct' method that does the same thing, so for ImageWithThumbsField it should be:
We should remove old 'south' code that is now unnecessary and add deconstruct method. After deconstruct method is defined there is a need to generate new migrations for all models using ImageWithThumbsField. I'm not really sure if having 'sizes' in migrations changes anything but for the sake of clarity I think it should be added with deconstruct method. Thoughts?