Thanks Marty, at least now I know why it's happening. :-) //emil
On 4 Jan, 21:35, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Jan 4, 2008 3:23 PM, Emil <[EMAIL PROTECTED]> wrote: > > > > > Hi people, > > > I'm working on a project where I try to utilize the dumpdata and > > loaddata commands from manage.py to extract and load data, since I'm > > constantly moving stuff I'm entering into the db between local > > development server and test server. > > > However, I find myself consantly having to change the path to my > > images manually in the xml files, since the full path, including > > domain (like 'http://example.test/media/image.jpg'on the devel > > server, 'http://example.domain.com/media/image.jpg'on the testing > > server) gets stored in the db - or at least in the xml dump. Isn't the > > ImageField only supposed to store only the file path relative to media > > root? > > > Luckily, I don't have that many entries in the db at this time, and > > search & replace helps out, but still - I shouldn't be forced to > > change MEDIA_URL to only an absolute file path without the domain > > (like "/media/" instead of "http://example.com/media/"), right? > > This has been reported, and is being tracked as issue #5574. I looked > at it briefly during my work on updating FileField, but it looks more > like a question for serialization experts (of which I'm not one). The > short story is: yes, the database does store just the path *after* > MEDIA_ROOT, but the serializer prepends MEDIA_URL to it. > > If I had to hazard a guess, I'd wager that this was done in an attempt > to allow consumers of the serialized data to retrieve the actual files > themselves, using only the information provided in the serialized > output. But, as you and others have noticed, this approach causes > problems when using serialization as a means to transfer data from > database to database, without having to worry about the files > themselves. > > -Gul > > [1]http://code.djangoproject.com/ticket/5574 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---