Hello I have an image field in my photos model that has an
upload_to='event-photos/%Y/%m/%d/' variable but I am not sure how I
can reference this using streaming uploads.

before streaming uploads you could do something like:
p = Photo(**params)
p.save_photo_file(photo.filename, photo.content)

Is there a streaming uploads method that allows me to do something
simple like the above?

Right now I am simply doing this which obviously does not get the
directory structure that I want.

PATH_ROOT = os.path.join(MEDIA_ROOT, 'event-photos', ph.name)
IMAGE_PATH = os.path.join('event-photos', ph.name)
destination = open(PATH_ROOT, 'wb+')
for chunk in ph.chunks():
    destination.write(chunk)
destination.close()
p = Photo(event=event)
 p.photo = IMAGE_PATH
p.save()

Is there an easier way?

Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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