# HG changeset patch # User tflorac@xsup98-004.onf.fr # Date 1507839764 -7200 # Node ID 9ef00182d11a858f9b167537d5560a5913450ae9 # Parent 9992778530058f1a451e6692c48ab5d8ed176f8c Added timestamp to download links diff -r 999277853005 -r 9ef00182d11a 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