Migrate existing third-party Django model to new customized model

119 views Asked by At

I'm using django-filer for file handling. It has abstract model BaseImage and also there is default model for images called Image which inherits from BaseImage and not abstract.

Also, this package allows to specify custom model for images: it hooks import of Image model, checks FILER_IMAGE_MODEL setting and return custom model if it's specified instead of Image. here is the code

So, customizing is easy -- I inherited my model CustomImage from BaseImage and specified necessary setting -- all works fine. But here comes trouble: how to properly migrate existing data from old models to new ones?

1

There are 1 answers

0
jvc26 On

You need to run a data migration the details of which will depend on your models.