Skip to content

Commit c8c389f

Browse files
committed
Add migrations to enable a smooth transition to django-pictures
We to migrate from django-stimage to pictures, we need to include variations into the migration model state. This allows deleting obsolite files during the migration.
1 parent 62dbd15 commit c8c389f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

stdimage/models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,19 @@ def save_form_data(self, instance, data):
307307
file.delete(save=False)
308308
super().save_form_data(instance, data)
309309

310+
def deconstruct(self):
311+
name, path, args, kwargs = super().deconstruct()
312+
return (
313+
name,
314+
path,
315+
args,
316+
{
317+
**kwargs,
318+
"variations": self._variations,
319+
"force_min_size": self.force_min_size,
320+
},
321+
)
322+
310323

311324
class JPEGFieldFile(StdImageFieldFile):
312325
@classmethod

0 commit comments

Comments
 (0)