I am having trouble loading Django into my MySQL database due to content type conflicts. At first, I tried to dump data only from my application as follows:
./manage.py dumpdata escola > fixture.json
but I kept getting the missing external issues because my escola application uses tables from other applications. I continued to add additional applications until I got to this:
./manage.py dumpdata contenttypes auth escola > fixture.json
Now the problem is the following violation of restrictions when trying to load data as a test device:
IntegrityError: (1062, "Duplicate entry 'escola-t23aluno' for key 2")
The problem seems to be that Django is trying to dynamically recreate content types with different primary key values that contradict the primary key values from the device. This is similar to the error described here: http://code.djangoproject.com/ticket/7052
The problem is that the recommended solution is to reset the contenttypes application, which I already do !? What gives? If this makes any difference, I have some user model permissions, as described here: http://docs.djangoproject.com/en/dev/ref/models/options/#permissions
django mysql django-models mysql-error-1062 fixtures
user27478 May 12, '09 at 17:02 2009-05-12 17:02
source share