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,8 +200,10 @@ class BaseView(GenericView, I18NView): | ||||||
|     def modified(self): |     def modified(self): | ||||||
|         """ get date/time of last modification |         """ get date/time of last modification | ||||||
|         """ |         """ | ||||||
|         dc = IZopeDublinCore(self.context) |         d = getattr(self.adapted, 'modified', None) | ||||||
|         d = dc.modified or dc.created |         if not d: | ||||||
|  |             dc = IZopeDublinCore(self.context) | ||||||
|  |             d = dc.modified or dc.created | ||||||
|         return d and d.strftime('%Y-%m-%d %H:%M') or '' |         return d and d.strftime('%Y-%m-%d %H:%M') or '' | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|  |  | ||||||
|  | @ -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 | #  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 | #  it under the terms of the GNU General Public License as published by | ||||||
|  | @ -24,6 +24,7 @@ Original authors: Johann Schimpf, Erich Seifert. | ||||||
| $Id$ | $Id$ | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
|  | from datetime import datetime | ||||||
| from logging import getLogger | from logging import getLogger | ||||||
| import os | import os | ||||||
| 
 | 
 | ||||||
|  | @ -83,8 +84,12 @@ class MediaAsset(MediaAssetFile, ExternalFileAdapter): | ||||||
|         storage = component.getUtility(IExternalStorage, name=self.storageName) |         storage = component.getUtility(IExternalStorage, name=self.storageName) | ||||||
|         #print '***', self.storageName, self.storageParams, self.options |         #print '***', self.storageName, self.storageParams, self.options | ||||||
|         return storage.getDir(self.externalAddress, |         return storage.getDir(self.externalAddress, | ||||||
|                               #self.options['storage_parameters']) |  | ||||||
|                               self.storageParams['subdirectory']) |                               self.storageParams['subdirectory']) | ||||||
| 
 | 
 | ||||||
|     def getOriginalData(self): |     def getOriginalData(self): | ||||||
|         return ExternalFileAdapter.getData(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