Hi,

I want to add already uploaded images to a models ImageFileField. I
finally managed to do this as follows:

(in the shell):
-----------------------------------
from trips.models import Event
from leden.models import Lid
from foto.models import Foto
from django.core.files.base import File
from django.db.models.fields.files import ImageFieldFile

e = Event.objects.all()[0]
l = Lid.objects.all()[0]
i = File(open('/Volumes/Data/Dev/dsac/media/foto/IMG_2620.JPG'))
c = 'bla'

f = Foto(caption=c,creator=l,event=e)
f.image.save(i.name, i)
f.save()
--------------------------------
However, 'f.image.save' takes quite some time. Why is this? The file
is not resaved, at least as far as I can see from the 'date last
modified'. Is there a quicker way to do this?

Thanks,

TiNo


--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to