take modification date for media assets from file, not from the resource object
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3229 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									c649dc8fd7
								
							
						
					
					
						commit
						095d6589c0
					
				
					 2 changed files with 11 additions and 4 deletions
				
			
		|  | @ -200,6 +200,8 @@ class BaseView(GenericView, I18NView): | |||
|     def modified(self): | ||||
|         """ get date/time of last modification | ||||
|         """ | ||||
|         d = getattr(self.adapted, 'modified', None) | ||||
|         if not d: | ||||
|             dc = IZopeDublinCore(self.context) | ||||
|             d = dc.modified or dc.created | ||||
|         return d and d.strftime('%Y-%m-%d %H:%M') or '' | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| # | ||||
| #  Copyright (c) 2008 Helmut Merz helmutm@cy55.de | ||||
| #  Copyright (c) 2009 Helmut Merz helmutm@cy55.de | ||||
| # | ||||
| #  This program is free software; you can redistribute it and/or modify | ||||
| #  it under the terms of the GNU General Public License as published by | ||||
|  | @ -24,6 +24,7 @@ Original authors: Johann Schimpf, Erich Seifert. | |||
| $Id$ | ||||
| """ | ||||
| 
 | ||||
| from datetime import datetime | ||||
| from logging import getLogger | ||||
| import os | ||||
| 
 | ||||
|  | @ -83,8 +84,12 @@ class MediaAsset(MediaAssetFile, ExternalFileAdapter): | |||
|         storage = component.getUtility(IExternalStorage, name=self.storageName) | ||||
|         #print '***', self.storageName, self.storageParams, self.options | ||||
|         return storage.getDir(self.externalAddress, | ||||
|                               #self.options['storage_parameters']) | ||||
|                               self.storageParams['subdirectory']) | ||||
| 
 | ||||
|     def getOriginalData(self): | ||||
|         return ExternalFileAdapter.getData(self) | ||||
| 
 | ||||
|     @property | ||||
|     def modified(self): | ||||
|         return datetime.fromtimestamp(os.path.getctime(self.getDataPath())) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm