make modification date for media assets editable
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3231 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
095d6589c0
commit
7294bc122b
1 changed files with 10 additions and 3 deletions
|
@ -50,6 +50,8 @@ class MediaAsset(MediaAssetFile, ExternalFileAdapter):
|
|||
|
||||
implements(IMediaAsset)
|
||||
|
||||
_adapterAttributes = ExternalFileAdapter._adapterAttributes + ('modified',)
|
||||
|
||||
isMediaAsset = True
|
||||
|
||||
def __init__(self, context):
|
||||
|
@ -89,7 +91,12 @@ class MediaAsset(MediaAssetFile, ExternalFileAdapter):
|
|||
def getOriginalData(self):
|
||||
return ExternalFileAdapter.getData(self)
|
||||
|
||||
@property
|
||||
def modified(self):
|
||||
return datetime.fromtimestamp(os.path.getctime(self.getDataPath()))
|
||||
def getModified(self):
|
||||
d = getattr(self.context, '_modified', None)
|
||||
if d is None:
|
||||
return datetime.fromtimestamp(os.path.getctime(self.getDataPath()))
|
||||
return d
|
||||
def setModified(self, value):
|
||||
self.context._modified = value
|
||||
modified = property(getModified, setModified)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue