Generally: I have possibly wrong data in the data base. But i think django does not help, to find these wrong data. I made "django-admin dumpdata" and i got this error: """ Unable to serialize database: ContentType matching query does not exist. """ I can set "--verbosity=2", but i get no more information :(
I examined and make a small test app... conclusion: It does not have to do anything with the serialize process! The error comes if I access the model object: ------------------------------------------------------------------- from django.db.models import get_apps, get_models for app in get_apps(): for model in get_models(app): model_objects = model.objects.all() print "test:", model_objects ------------------------------------------------------------------- tree print lines appears. The the error: ------------------------------------------------------------------- Traceback (most recent call last): File "W:\SVN\SVN PyLucid\branches\0.8(django)\test2.py", line 14, in ? print "test:", model_objects File "./django/db/models/query.py", line 102, in __repr__ File "./django/db/models/base.py", line 81, in __repr__ File "./django/contrib/auth/models.py", line 48, in __str__ File "./django/db/models/fields/related.py", line 171, in __get__ File "./django/db/models/manager.py", line 73, in get File "./django/db/models/query.py", line 250, in get django.db.models.base.DoesNotExist: ContentType matching query does not exist. ------------------------------------------------------------------- What am I to do, now? Russell Keith-Magee schrieb: > Ok; the error you reported previously (app_label, model not unique) is > being caused when deserializing the contenttype model in the > contenttypes application. This model requires that the fields > app_label and model are a unique pair. The error will be generated > either because: > > 1) your data file contains a duplicate entry, or IMHO, that cannot happen actually. I create the fixture file with django and not write it by hand ;) > 2) you aren't flushing the existing data before inserting the new > data, so when you deserialize, you are duplicating data in the > database. I make only this: ------------------------------------------------------------------- objects = serializers.deserialize(format, fixture) for object in objects: object.save() ------------------------------------------------------------------- Do I have to delete first the tables? But that cannot be also. I deleted the SQLite file. Thus no data are present. the complete routines are here: http://pylucid.net/trac/browser/branches/0.8%28django%29/PyLucid/install/install.py -- Mfg. Jens Diemer ---- CMS in pure Python CGI: http://www.pylucid.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---