Ordering of DCIM models break dumpdata/loaddata functionality #3849
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Environment
Steps to Reproduce
./manage.py dumpdata -o <filename> --natural-foreign --natural-primary --indent 4 --format json
./manage.py loaddata <filename>
Expected Behavior
All data should be imported successfully
Observed Behavior
An
AttrbiuteError
is raised:This is because Django is exporting Cables prior to exporting PowerFeeds. Upon import, Django is attempting to create cables to terminations that don't yet exist, hence the exception.
Presumably, this can be fixed by moving the Cable model definition so that it comes after PowerFeed in
models.py
.The text was updated successfully, but these errors were encountered: