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.
--
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
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
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.
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 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
6 matches
Mail list logo