문제

I have a model Lecture with some m2m fields in it, which I would like to dump using dumpdata.

But whenever I call python manage.py dumpdata cms.lecture I get the following error

CommandError: Unable to serialize database: 'NoneType' object has no attribute '_meta'.

Is this because of the m2m-field or what could be the problem here?

My Database is MySql (version 5.6.12) and I'm using Django 1.5.1. I used Sqlite before and it worked fine.

도움이 되었습니까?

해결책

Source :

Putting

self.serialize = False

into managers.py (around line 75) seems to fix the issue for me.

Edit: of course, adding it to the Field.init call as serialize=False is a much better idea.
Edit2: additionally null used to be set to True but now defaults to False and perhaps should also be added to the constructor.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top