Initial staging file handling
This commit is contained in:
@@ -59,7 +59,6 @@
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -3,4 +3,23 @@
|
||||
|
||||
{% block content %}
|
||||
{% include "generic_form_subtemplate.html" %}
|
||||
|
||||
{% for subtemplate in subtemplates_dict %}
|
||||
{% with subtemplate.title as title %}
|
||||
{% with subtemplate.object_list as object_list %}
|
||||
{% with subtemplate.extra_columns as extra_columns %}
|
||||
{% with subtemplate.hide_object as hide_object %}
|
||||
{% with subtemplate.main_object as main_object %}
|
||||
{% with subtemplate.hide_link as hide_link %}
|
||||
<div class="content">
|
||||
{% include subtemplate.name %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -13,3 +13,4 @@ FILESERVING_PATH = getattr(settings, 'DOCUMENTS_FILESERVING_PATH', u'/tmp')
|
||||
DELETE_ORIGINAL = getattr(settings, 'DOCUMENTS_DELETE_ORIGINAL', False)
|
||||
SLUGIFY_PATH = getattr(settings, 'DOCUMENTS_SLUGIFY_PATH', False)
|
||||
CHECKSUM_FUNCTION = getattr(settings, 'DOCUMENTS_CHECKSUM_FUNCTION', lambda x: hashlib.sha256(x).hexdigest())
|
||||
DELETE_STAGING_FILE_AFTER_UPLOAD = getattr(settings, 'DOCUMENTS_DELETE_STAGING_FILE_AFTER_UPLOAD', False)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import datetime
|
||||
import os
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
@@ -16,7 +17,8 @@ from forms import DocumentForm_view
|
||||
from models import Document, DocumentMetadata, DocumentType, MetadataType
|
||||
from forms import DocumentTypeSelectForm, DocumentCreateWizard, \
|
||||
MetadataForm, DocumentForm
|
||||
|
||||
|
||||
from documents.conf.settings import STAGING_DIRECTORY
|
||||
|
||||
def document_list(request):
|
||||
return object_list(
|
||||
@@ -71,9 +73,20 @@ def upload_document_with_type(request, document_type_id, multiple=True):
|
||||
return HttpResponseRedirect(reverse('document_list'))
|
||||
else:
|
||||
form = DocumentForm(initial={'document_type':document_type})
|
||||
|
||||
filelist = sorted([os.path.normcase(f) for f in os.listdir(STAGING_DIRECTORY)])
|
||||
|
||||
return render_to_response('generic_form.html', {
|
||||
'form':form
|
||||
'form':form,
|
||||
'subtemplates_dict':[
|
||||
{
|
||||
'name':'generic_list_subtemplate.html',
|
||||
'title':_(u'files in staging'),
|
||||
'object_list':filelist,
|
||||
#'extra_columns':[{'name':_(u'qty'), 'attribute':'qty'}],
|
||||
},
|
||||
],
|
||||
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Create indexing filesystem folders from document type metadata type - DONE
|
||||
* Document detail to view document metadata - DONE
|
||||
* Add file checksums (hashlib) - DONE
|
||||
* Filter by metadata
|
||||
* Document list filtering by metadata
|
||||
* Jquery upload document upload form with ajax widget
|
||||
* Filterform date filtering widget
|
||||
* Validate GET data before saving file
|
||||
@@ -12,4 +12,5 @@
|
||||
* Delete symlinks when document is deleted of metadata changed
|
||||
* Check duplicated files using checksum
|
||||
* If theres only one document type on db skip step 1 of wizard
|
||||
|
||||
* Option to delete source staging file after upload
|
||||
* Show last 5 recent metadata setups for easy switch
|
||||
|
||||
Reference in New Issue
Block a user