This is a reference implementation, which allows to dump the files payload together with its meta-data, when running manage.py dumpdata > dumpfile.json.
manage.py dumpdata > dumpfile.json
A dumpfile which is reimported using manage.py loaddata dumpfile.json restores the file on disk.
This simplifies backups and migrations of projects using django-filer to manage their media data.
manage.py loaddata dumpfile.json
More details here: https://github.com/jrief/django-filer/blob/serialize-payload/docs/dump_payload.rst
This feature has been discussed on the mailing list in December 2012. It is fully backward compatible with existing dumps.
Added feature to dump payload of files using manage.py dumpdata
OMG, yes please!
A test to check for backward compat would be nice
making it storage backend agnostic would probably be pretty simple, by reading the file contents into a StringIO and then serializing them instead of manually reading them from the filesystem.
The Django maintainers do not seem to be very interested. This ticket
is still "new" since 5 weeks.
Merge branch 'develop' of https://github.com/stefanfoulis/django-filer …
Coverage decreased (-1.35%) when pulling 3f13386 on jrief:serialize-payload into 902d160 on stefanfoulis:develop.
I've implemented tests and storage agnostic dump on top of @jrief great work in https://github.com/nephila/django-filer/tree/feature/dump_data
If everybody agrees I'd close this PR and open a new one
+1 from my side :)
Closing this as it's integrated in #344