From 584e38abefff7694be513fc6ea32364814040df3 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Tue, 4 Mar 2014 16:02:23 +0100 Subject: [PATCH] [gen] Bugfix. --- fields/file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fields/file.py b/fields/file.py index fd0ba2c..62adc3d 100644 --- a/fields/file.py +++ b/fields/file.py @@ -16,7 +16,6 @@ # ------------------------------------------------------------------------------ import time, os.path, mimetypes, shutil -from DateTime import DateTime from appy import Object from appy.fields import Field from appy.px import Px @@ -147,6 +146,7 @@ class FileInfo: self.size = len(fileObj[1]) f.write(fileObj[1]) f.close() + from DateTime import DateTime self.modified = DateTime() def copyFile(self, fieldName, filePath, dbFolder): @@ -160,6 +160,7 @@ class FileInfo: self.mimeType= mimetypes.guess_type(filePath)[0] or File.defaultMimeType # Copy the file shutil.copyfile(filePath, self.fsName) + from DateTime import DateTime self.modified = DateTime() self.size = os.stat(self.fsName).st_size