Add date time creation column to staging folder upload view.

This commit is contained in:
Roberto Rosario
2015-09-06 04:09:31 -04:00
parent 3e3eca4c0e
commit 6dcdcdd5c7
2 changed files with 10 additions and 0 deletions

View File

@@ -57,6 +57,12 @@ class SourcesApp(MayanAppConfig):
view='sources:setup_source_list'
)
SourceColumn(
source=StagingFile,
label=_('Created'),
func=lambda context: context['object'].get_date_time_created()
)
SourceColumn(
source=StagingFile,
label=_('Thumbnail'),

View File

@@ -2,6 +2,7 @@ from __future__ import unicode_literals
import base64
import os
import time
import urllib
try:
@@ -62,6 +63,9 @@ class StagingFile(object):
file=open(self.get_full_path(), mode='rb'), name=self.filename
)
def get_date_time_created(self):
return time.ctime(os.path.getctime(self.get_full_path()))
def get_full_path(self):
return os.path.join(self.staging_folder.folder_path, self.filename)