Hey all, I recently ported a half dozen homebrewed applications from 0.96 to 1.0 (awesome!) and now I'm in the process of bumping them over from MySQL to Posgres so I can get ripping on GeoDjango (double awesome!).
This seemed like a great chance to give manage.py's ingenious "dumpdata" command a try to see if I can move things over that way. Unfortunately, I've run into a problem that I'm hoping you can help me through. Per usual, it's probably something dumb I did that's behind it. Basically, here's what's happening. The process works great for all of my apps except one, which is throwing an error every time I try to dump it. Here's the app-specific command I've been hitting to try and get it exported in json. I've substituted a generic app name, 'app_label', for the actual name. python manage.py dumpdata app_label --traceback --indent 4 > fixtures/ app_label.js And the traceback I get looks like this, with a sanitized model name substituted for the real thing. """ Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management/__init__.py", line 340, in execute_manager utility.execute() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management/__init__.py", line 295, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management/base.py", line 192, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management/base.py", line 219, in execute output = self.handle(*args, **options) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management/commands/dumpdata.py", line 48, in handle return serializers.serialize(format, objects, indent=indent) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/serializers/__init__.py", line 86, in serialize s.serialize(queryset, **options) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/serializers/base.py", line 47, in serialize self.handle_fk_field(obj, field) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/serializers/python.py", line 41, in handle_fk_field related = getattr(obj, field.name) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/models/fields/related.py", line 248, in __get__ rel_obj = QuerySet(self.field.rel.to).get(**params) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/models/query.py", line 308, in get raise self.model.DoesNotExist("%s matching query does not exist." django.db.models.base.DoesNotExist: Model matching query does not exist. "" The models.py is pretty simple. There are three models up top, each of which is linked to a root model by a ForeignKey field. That root model looks something like... """ class Model(models.Model): title = models.CharField(max_length=300) fk_1 = models.ForeignKey(fk_1) fk_2 = models.ForeignKey(fk_2) fk_3 = models.ForeignKey(fk_3) def __unicode__(self): return u'%s, %s' % (self.fk_1, self.fk_2) class Meta: ordering = ['fk_1',] """ The funny thing is that if I comment out that root model and run dumpdata again, everything goes swimmingly. So I'm guessing the problem is in there somewhere. As I've typed out this entirely too long email, I've started to think and maybe come up with the weird thing I did to screw it up. Would it matter if I initally imported that data outside of Django into the model and maybe stupidly left some of the FK fields null? Well, I think I'm going to go try that right now. If it's something else obvious, please let me know. Thanks listers! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---