Vizcayno wrote:
> .
> def save(self):
> self.doc_adj = '\\1996\\' + self.doc_adj
> super(MaeDoc, self).save()
>
> Data saves as expected in the Database (i.e. '\1996\{file name}'),
> however, the file was physically created in c:\attach\doc_adj\{file
> name}........ and not in c:\attach\1996\doc_adj\{file name} as I was
> expecting.
> Is there anything I omitted.
You can't just rename FileField, use following:
import shutil
def save(self:)
if self.doc_adj:
shutil.move(self.doc_adj, <new_name>)
self.doc_adj = <new_name>
<....>
--
Nebojša Đorđević - nesh
Studio Quattro - Niš - SCG
http://studioquattro.biz/ | http://trac.studioquattro.biz/djangoutils/
Registered Linux User 282159 [http://counter.li.org]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---