I am sure there is a simple answer here, but I do not see this. I am trying to load fixtures into my database, but no matter what model identifier I use, I keep getting the DeserializationError: invalid model identifier:... error.
File structure:
testproject/ testapp/ fixtures/ data.json __init__.py models.py tests.py views.py sqlite3.db __init__.py manage.py settings.py urls.py
Since this is my first exit to the fixtures, I use the model from http://www.djangoproject.com/documentation/models/fixtures/ :
from django.db import models from django.conf import settings class Article(models.Model): headline = models.CharField(max_length=100, default='Default headline') pub_date = models.DateTimeField() def __unicode__(self): return self.headline class Meta: ordering = ('-pub_date', 'headline')
data.json:
[ { "pk": "3", "model": "testapp.article", "fields": { "headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00" } }, { "pk": "2", "model": "testapp.article", "fields": { "headline": "Poker has no place on ESPN", "pub_date": "2006-06-16 12:00:00" } }, { "pk": "1", "model": "testapp.article", "fields": { "headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00" } } ]
I tried testapp.article , testproject.article , testproject.testapp.article and they all throw the same error. I run 1.2.4 with Python 2.6 and use loaddata, not syncdb. Any ideas?
source share