django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.73k stars 574 forks source link

Loaddata results in a FieldDoesNotExist error #1455

Closed tobyl closed 3 months ago

tobyl commented 3 months ago

When I try to import data via loaddata I see an error relating to django-filer:

Folder has no field named 'level'

If I manually tinker with the JSON file and remove level, lft, rght and tree_id keys from the two Folder objects the data loads as expected.

fsbraun commented 3 months ago

I would assume you are importing django-filer data exported with a django-filer version below 3 into django-filer version >= 3.

With django-filer 3 the data structures changed and django-mptt was removed from filer. This also removed the fields level, lft, rght, and tree_id. There is no need for replacement. Removing the fields from the JSON therefore should work fine.

tobyl commented 3 months ago

Ah, that makes sense.. I thought I had confirmed the versions before posting, but I must have been mistaken - thank you!