Added timestamp to download links
authortflorac@xsup98-004.onf.fr
Thu, 12 Oct 2017 22:22:44 +0200
changeset 61 9ef00182d11a
parent 60 999277853005
child 62 cd4af122cd93
Added timestamp to download links
src/pyams_file/widget/__init__.py
--- a/src/pyams_file/widget/__init__.py	Thu Oct 12 22:21:17 2017 +0200
+++ b/src/pyams_file/widget/__init__.py	Thu Oct 12 22:22:44 2017 +0200
@@ -9,7 +9,6 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from pyramid.interfaces import IView
 
 __docformat__ = 'restructuredtext'
 
@@ -17,11 +16,13 @@
 # import standard library
 import os
 from cgi import FieldStorage
+from datetime import datetime
 
 # import interfaces
 from pyams_file.interfaces import IFileField, IFileWidget, IImageField, IImageWidget, \
     IThumbnailImageWidget, IThumbnailImageField, DELETED_FILE, IThumbnail
 from pyams_form.interfaces.form import IFormLayer
+from pyramid.interfaces import IView
 from z3c.form.interfaces import NOT_CHANGED, IFieldWidget, IDataConverter
 
 # import packages
@@ -70,6 +71,10 @@
     """File widget"""
 
     @property
+    def timestamp(self):
+        return datetime.utcnow().timestamp()
+
+    @property
     def current_value(self):
         if self.form.ignoreContext:
             return None