On Mon, 2007-10-22 at 07:03 -0500, Ariel Mauricio Nunez Gomez wrote:
> Thanks for your comments Russell,
> 
> I was refering to my own django install, I agree that it's not by any
> chance a solution for the general problem.
> 
> Do you think it would be adequate to report the issue in trac? 

I think you're misunderstanding. There's no bug or issue here, at least
as far as you've explained it. Django's loaddata simply isn't designed
for data that isn't fully specified, which includes the pk value.
Instead, it's designed to handle the stuff written out by dumpdata.

If you want to load data that has some slightly different format, as
you've indicated, I wouldn't be looking at loaddata at all -- that's too
specialised. I'd be subclassing the appropriate serializer class and
overriding a few of the methods to look up the starting pk value and
fill them in. That requires no changes to core at all and should be
reasonably straightforward: the serializers (including the deserializer
classes, which is what you're talking about here) are state-based
parsing machines. So it's a matter of putting your hooks into the right
states. They're pretty well documented and there are four examples
already (json, yaml, python and xml) to get you started.

It really sounds like subclassing the deserializer for whichever format
you're using would be the "correct" place to solve this.

Regards,
Malcolm

-- 
If you think nobody cares, try missing a couple of payments. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to