When I try to dump the data of my model in Django with this instruction :
python manage.py dumpdata app> temp_data.json
It gives the following error :
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".
The thing is that these tables are auto-generated by django. Plus I just checked in the database (mysql) and the fields are varchar(100).
What’s wrong ?
Those tables are generated by a
manage.py inspectdbright? Then you don’t need to include django’s own models into the actual generated models. Just remove any model starting withauth,django,adminandsite.Just include the corresponding contrib apps to the INSTALLED_APPS setting and voila, no more errors.