【发布时间】:2011-10-25 02:42:28
【问题描述】:
当我尝试使用这条指令在 Django 中转储我的模型数据时:
python manage.py dumpdata app> temp_data.json
它给出了以下错误:
Error: One or more models did not validate:
asset.authpermission: "codename": CharField cannot have a "max_length" greater than 255 when using "unique=True".
asset.djangocontenttype: "app_label": CharField cannot have a "max_length" greater than 255 when using "unique=True".
asset.djangocontenttype: "model": CharField cannot have a "max_length" greater than 255 when using "unique=True".
问题是这些表是由 django 自动生成的。另外我刚刚检查了数据库(mysql),字段是varchar(100)。
怎么了?
【问题讨论】:
标签: django django-models dump django-database