开发者

Dumping one class type with Django dumpdata

I use dumpdata to output all my apps's classes. One of my app has one class that never get's outputted and I don't know where to start looking to know what's wrong. The 开发者_如何学编程class is used regularly, every other classes in the app are dumped fine and dumpdata doesn't throw any error.

Any clue ?


You might try serializing it to json and see if you get any errors there -- maybe there's a subtle inconsistency that's messing up the serialization.

>>> from django.core import serializers
>>> from myapp.mymodels import mymodel
>>> serializers.serialize('json', mymodel.objects.all())
[...]

This might be worth a try too:

>>> serializers.serialize('python', mymodel.objects.all())
[...]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜