I was a little bummed to discover that the Postgres blob support we  
depend on at work I can't use through Django in a project for myself.  
I'm trying to keep multiple versions of an original document  
(including the embedded content that's inside the file) and had  
planned on using blobs to store the binary data. At some point in the  
past, it may have been more inefficient to store binary data inside  
the database, but we have an application at work that stores thousands  
of reports per day and serves them to a report viewer application. It  
allows for an environment-agnostic way to retrieve and store those  
files and I don't have to worry about path prefixes and the various  
problems of managing a messy directory structure of a large number of  
files (I guess I'm supposed to just tar up the files using a cron job  
to back them up? Sounds like a pain).

I'm having to change the way I was planning on handling these files  
and I'm not sure how to go about doing that. I have an abstract  
representation of the document as a model and I need to add the  
uploaded document as a version attached to that document model. It's  
not date-based, but hash-based. I need to store the file in a  
directory outside the document root (I don't want the original  
directly accessible) I guess using some scheme like:

"/my/docs/dir/%id1/%id2/%hash/mydoc.doc"

How do I get from where Django will put the uploaded file to where I  
really want the file stored (which is based on values I won't know  
until everything is saved) and make sure the file field gets updated  
to reflect the new path? Can I even move the file after it's been  
uploaded? The whole concept of "upload_to" seems pretty limiting to me  
because the uploaded file is just the first part of a processing chain  
that's more interested in what's inside the file than it is with the  
file itself.

I guess I'm just a little fuzzy on how manipulating files is supposed  
to work doing it the "django way". Any help would be appreciated.

Thanks!

Jon Brisbin
http://jbrisbin.com
--~--~---------~--~----~------------~-------~--~----~
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