Hi,
I've written a custom Storage that uses WebDAV as its underlying
engine. When I save a file '/foo/bar/file.ext', I want it to be saved
under /foo/bar in the webdav filesystem. However, it seems that
FileField overrides the directory structure:
def generate_filename(self, instance, filename):
return os.path.join(self.get_directory_name(),
self.get_filename(filename))
where get_directory_name() is defined as
def get_directory_name(self):
return
os.path.normpath(force_unicode(datetime.datetime.now().strftime(smart_str(self.upload_to))))
I'm not really sure why FileField finds it appropriate to impose its
own directory structure on the underlying storage engine. But short
of creating a custom subclass of FileField and overriding
generate_filename and/or get_directory_name(), is there a different
way of preserving the original file location path?
Thanks
Dmitry
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.