Re: loaddata not looking for natural keys

2014-03-24 Thread bobhaugen
Ok, problem resolved. I must have done something else wrong the last time I did loaddata, because I tried the whole sequence again with the natural_keys as tuples, and it all worked. Sorry to bother the list so much. But to summarize, natural_keys must be tuples, not single unicode values. --

Re: loaddata not looking for natural keys

2014-03-24 Thread bobhaugen
Not a tuple, it's now a json array. (Still not seeing things accurately...) So I would think it would deserialize with __iter__, but I still get the same deserialization error message. On Monday, March 24, 2014 8:38:52 AM UTC-5, bobhaugen wrote: > > Got a clue. I re-read the doc and it says the

Re: loaddata not looking for natural keys

2014-03-24 Thread bobhaugen
Got a clue. I re-read the doc and it says the natural key value must be a tuple. Missed that before. So I changed it like this: def natural_key(self): return (self.name,) In the shell, that properly returns a tuple: (u'Cash Contribution',) But in the dumpdata results, it is not

Re: loaddata not looking for natural keys

2014-03-23 Thread bobhaugen
Ok, now I am really confused. Here's the code where the error originates in django/core/serializers/python.py: # Handle FK fields elif field.rel and isinstance(field.rel, models.ManyToOneRel): if field_value is not None: import pdb; pdb.

Re: loaddata not looking for natural keys

2014-03-22 Thread bobhaugen
Oh, and I am using Django 1.4.5. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

loaddata not looking for natural keys

2014-03-22 Thread bobhaugen
loaddata error message: File "/home/bob/.virtualenvs/vn2/lib/python2.6/site-packages/django/core/serializers/json.py", line 47, in Deserializer raise DeserializationError(e) DeserializationError: [u"'Cash Contribution' value must be an integer."] Here's how I dumped the data: ./manage.py