Hi,

I have a fairly standard model:

class MediaObject(models.Model):
    """ An instance of a MediaItem """
    name = models.CharField(max_length=256)
    path = models.FileField(_("File"), max_length=256,
upload_to='tempUpload/')

And thats all well and good, my uploads work and so on.
But what I currently do is I upload to a temporary directory (as shown
above), then the upload triggers some processing on the file.

Then I want to move the file. Before the process actually modified the
database directly, updating the path to a new location. But we don't
want to do that anymore as I want to provide a RESTapi to update the
location of the file.

I have read through: 
http://docs.djangoproject.com/en/dev/topics/files/#topics-files

But seeing as Django uses the python File type it seems that I can't
update the path?

Is there a method of moving the file or the path? I would prefer not
to read in the file into memory if possible (my files can be Gb's in
size).

The only way I thought of getting around this limitation is to provide
the RESTApi but just use raw SQL instead and update the location.
Though I think that should be the last resort.

Any help would be appreciated.

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