Initial version of the GridFS storage driver

This commit is contained in:
Roberto Rosario
2011-03-04 01:08:20 -04:00
parent 3f71ee1a06
commit d0bea8ffeb
13 changed files with 218 additions and 183 deletions

View File

@@ -1,10 +1,11 @@
import os
import types
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from common.utils import exists_with_famfam
from common.conf import settings as common_settings
from documents.conf import settings as documents_settings
from converter.conf import settings as converter_settings
@@ -68,7 +69,7 @@ def check_settings(request):
'extra_columns':[
{'name':_(u'name'), 'attribute':'name'},
{'name':_(u'value'), 'attribute': lambda x: _return_type(x['value'])},
{'name':_(u'exists'), 'attribute':lambda x: _exists(x['value']) if 'exists' in x else ''},
{'name':_(u'exists'), 'attribute':lambda x: exists_with_famfam(x['value']) if 'exists' in x else ''},
]
}
@@ -88,15 +89,6 @@ def _return_type(value):
else:
return value
def _exists(path):
try:
if os.path.exists(path):
return '<span class="famfam active famfam-tick"></span>'
else:
return '<span class="famfam active famfam-cross"></span>'
except Exception, exc:
return exc
def blank_menu(request):
return render_to_response('generic_template.html', {