Add date time creation column to staging folder upload view.
This commit is contained in:
@@ -57,6 +57,12 @@ class SourcesApp(MayanAppConfig):
|
|||||||
view='sources:setup_source_list'
|
view='sources:setup_source_list'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SourceColumn(
|
||||||
|
source=StagingFile,
|
||||||
|
label=_('Created'),
|
||||||
|
func=lambda context: context['object'].get_date_time_created()
|
||||||
|
)
|
||||||
|
|
||||||
SourceColumn(
|
SourceColumn(
|
||||||
source=StagingFile,
|
source=StagingFile,
|
||||||
label=_('Thumbnail'),
|
label=_('Thumbnail'),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -62,6 +63,9 @@ class StagingFile(object):
|
|||||||
file=open(self.get_full_path(), mode='rb'), name=self.filename
|
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):
|
def get_full_path(self):
|
||||||
return os.path.join(self.staging_folder.folder_path, self.filename)
|
return os.path.join(self.staging_folder.folder_path, self.filename)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user