Code cleanup
This commit is contained in:
@@ -29,6 +29,7 @@ if common_settings.AUTO_CREATE_ADMIN:
|
||||
# the "syncdb" command during database creation.)
|
||||
#
|
||||
# Create our own test user automatically.
|
||||
|
||||
def create_testuser(app, created_models, verbosity, **kwargs):
|
||||
USERNAME = common_settings.AUTO_ADMIN_USERNAME
|
||||
PASSWORD = common_settings.AUTO_ADMIN_PASSWORD
|
||||
|
||||
@@ -111,4 +111,3 @@ class UserForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ('first_name', 'last_name')
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ except:
|
||||
import mimetypes
|
||||
mimetypes.init()
|
||||
USE_PYTHON_MAGIC = False
|
||||
|
||||
|
||||
|
||||
def urlquote(link=None, get=None):
|
||||
u'''
|
||||
@@ -357,7 +357,7 @@ def get_mimetype(filepath):
|
||||
"""
|
||||
file_mimetype = u''
|
||||
file_mime_encoding = u''
|
||||
|
||||
|
||||
if USE_PYTHON_MAGIC:
|
||||
if os.path.exists(filepath):
|
||||
try:
|
||||
@@ -373,7 +373,7 @@ def get_mimetype(filepath):
|
||||
else:
|
||||
path, filename = os.path.split(filepath)
|
||||
file_mimetype, file_mime_encoding = mimetypes.guess_type(filename)
|
||||
|
||||
|
||||
return file_mimetype, file_mime_encoding
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ def validate_path(path):
|
||||
os.mkdir(path)
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
# Check if it is writable
|
||||
try:
|
||||
fd, test_filepath = tempfile.mkstemp(dir=path)
|
||||
@@ -392,5 +392,5 @@ def validate_path(path):
|
||||
os.unlink(test_filepath)
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
return True
|
||||
|
||||
@@ -105,7 +105,7 @@ def assign_remove(request, left_list, right_list, add_method, remove_method, lef
|
||||
'form': unselected_list,
|
||||
'title': left_list_title,
|
||||
'submit_label': _(u'Add'),
|
||||
'submit_icon_famfam': 'add'
|
||||
'submit_icon_famfam': 'add'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -145,7 +145,7 @@ def current_user_details(request):
|
||||
Display the current user's details
|
||||
"""
|
||||
form = UserForm_view(instance=request.user)
|
||||
|
||||
|
||||
return render_to_response(
|
||||
'generic_form.html', {
|
||||
'form': form,
|
||||
@@ -153,15 +153,15 @@ def current_user_details(request):
|
||||
'read_only': True,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
|
||||
def current_user_edit(request):
|
||||
"""
|
||||
Allow an user to edit his own details
|
||||
"""
|
||||
|
||||
|
||||
next = request.POST.get('next', request.GET.get('next', request.META.get('HTTP_REFERER', reverse('current_user_details'))))
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
form = UserForm(instance=request.user, data=request.POST)
|
||||
if form.is_valid():
|
||||
@@ -170,11 +170,11 @@ def current_user_edit(request):
|
||||
return HttpResponseRedirect(next)
|
||||
else:
|
||||
form = UserForm(instance=request.user)
|
||||
|
||||
|
||||
return render_to_response(
|
||||
'generic_form.html', {
|
||||
'form': form,
|
||||
'next': next,
|
||||
'title': _(u'edit current user details'),
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@@ -129,6 +129,9 @@ class ConverterClass(ConverterBase):
|
||||
for format_name in Image.ID:
|
||||
formats.append((format_name, u''))
|
||||
|
||||
#if USE_GHOSTSCRIPT:
|
||||
#PDF, PS
|
||||
|
||||
return formats
|
||||
|
||||
def get_available_transformations(self):
|
||||
@@ -147,30 +150,30 @@ class ConverterClass(ConverterBase):
|
||||
'''
|
||||
#preresize image with factor 2, 4, 8 and fast algorithm
|
||||
factor = 1
|
||||
while img.size[0]/factor > 2*box[0] and img.size[1]*2/factor > 2*box[1]:
|
||||
while img.size[0]/factor > 2 * box[0] and img.size[1] * 2/factor > 2 * box[1]:
|
||||
factor *=2
|
||||
if factor > 1:
|
||||
img.thumbnail((img.size[0]/factor, img.size[1]/factor), Image.NEAREST)
|
||||
img.thumbnail((img.size[0] / factor, img.size[1] / factor), Image.NEAREST)
|
||||
|
||||
#calculate the cropping box and get the cropped part
|
||||
if fit:
|
||||
x1 = y1 = 0
|
||||
x2, y2 = img.size
|
||||
wRatio = 1.0 * x2/box[0]
|
||||
hRatio = 1.0 * y2/box[1]
|
||||
wRatio = 1.0 * x2 / box[0]
|
||||
hRatio = 1.0 * y2 / box[1]
|
||||
if hRatio > wRatio:
|
||||
y1 = y2/2-box[1]*wRatio/2
|
||||
y2 = y2/2+box[1]*wRatio/2
|
||||
y1 = y2 / 2 - box[1] * wRatio / 2
|
||||
y2 = y2 / 2 + box[1] * wRatio / 2
|
||||
else:
|
||||
x1 = x2/2-box[0]*hRatio/2
|
||||
x2 = x2/2+box[0]*hRatio/2
|
||||
img = img.crop((x1,y1,x2,y2))
|
||||
x1 = x2 / 2 - box[0] * hRatio / 2
|
||||
x2 = x2 / 2 + box[0] * hRatio / 2
|
||||
img = img.crop((x1, y1, x2, y2))
|
||||
|
||||
#Resize the image with best quality algorithm ANTI-ALIAS
|
||||
img.thumbnail(box, Image.ANTIALIAS)
|
||||
|
||||
if out:
|
||||
#save it into a file-like object
|
||||
img.save(out, "JPEG", quality=75)
|
||||
img.save(out, 'JPEG', quality=75)
|
||||
else:
|
||||
return img
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.conf import settings
|
||||
from django.conf import settings
|
||||
from django.contrib.comments.models import Comment
|
||||
|
||||
from navigation.api import register_links, \
|
||||
|
||||
@@ -4,6 +4,6 @@ urlpatterns = patterns('document_indexing.views',
|
||||
url(r'^(?P<index_id>\d+)/list/$', 'index_instance_list', (), 'index_instance_list'),
|
||||
url(r'^list/$', 'index_instance_list', (), 'index_instance_list'),
|
||||
url(r'^rebuild/all/$', 'rebuild_index_instances', (), 'rebuild_index_instances'),
|
||||
|
||||
|
||||
url(r'^list/for/document/(?P<document_id>\d+)/$', 'document_index_list', (), 'document_index_list'),
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ def index_instance_list(request, index_id=None):
|
||||
index_instance_list = IndexInstance.objects.filter(parent=None)
|
||||
breadcrumbs = get_instance_link()
|
||||
index_instance = None
|
||||
|
||||
|
||||
show_multi_select_buttons = False
|
||||
if index_instance:
|
||||
if index_instance.index.link_documents:
|
||||
@@ -87,7 +87,7 @@ def rebuild_index_instances(request):
|
||||
def document_index_list(request, document_id):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_VIEW, PERMISSION_DOCUMENT_INDEXING_VIEW])
|
||||
document = get_object_or_404(Document, pk=document_id)
|
||||
|
||||
|
||||
object_list = []
|
||||
|
||||
for index_instance in document.indexinstance_set.all():
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.conf import settings
|
||||
|
||||
from common.utils import validate_path
|
||||
from navigation.api import register_links, register_top_menu, \
|
||||
@@ -28,6 +26,7 @@ from documents.conf.settings import ZOOM_MIN_LEVEL
|
||||
from documents.conf.settings import CACHE_PATH
|
||||
from documents.widgets import document_thumbnail
|
||||
|
||||
|
||||
# Document page links expressions
|
||||
def is_first_page(context):
|
||||
return context['object'].page_number <= 1
|
||||
@@ -35,7 +34,7 @@ def is_first_page(context):
|
||||
|
||||
def is_last_page(context):
|
||||
return context['object'].page_number >= context['object'].document.documentpage_set.count()
|
||||
|
||||
|
||||
|
||||
def is_min_zoom(context):
|
||||
return context['zoom'] <= ZOOM_MIN_LEVEL
|
||||
@@ -129,7 +128,7 @@ register_links(['setup_document_type_metadata', 'document_type_filename_delete',
|
||||
register_links(['document_type_filename_create', 'document_type_filename_list', 'document_type_filename_edit', 'document_type_filename_delete'], [document_type_filename_create], menu_name='sidebar')
|
||||
register_links(['document_type_filename_edit', 'document_type_filename_delete'], [document_type_filename_return_to_document_type], menu_name='sidebar')
|
||||
|
||||
# Register document links
|
||||
# Register document links
|
||||
register_links(Document, [document_edit, document_print, document_delete, document_download, document_find_duplicates, document_clear_transformations, document_create_siblings])
|
||||
register_multi_item_links(['document_find_duplicates', 'folder_view', 'index_instance_list', 'document_type_document_list', 'search', 'results', 'document_group_view', 'document_list', 'document_list_recent'], [document_multiple_clear_transformations, document_multiple_delete])
|
||||
|
||||
@@ -185,8 +184,8 @@ register_model_list_columns(Document, [
|
||||
])
|
||||
|
||||
register_top_menu(
|
||||
'documents',
|
||||
link={'famfam': 'page', 'text': _(u'documents'), 'view': 'document_list_recent'},
|
||||
'documents',
|
||||
link={'famfam': 'page', 'text': _(u'documents'), 'view': 'document_list_recent'},
|
||||
children_path_regex=[
|
||||
r'^documents/[^t]', r'^metadata/[^s]', r'comments', r'tags/document', r'grouping/[^s]', r'history/list/for_object/documents'
|
||||
],
|
||||
|
||||
@@ -178,7 +178,7 @@ class DocumentForm(forms.ModelForm):
|
||||
if instance:
|
||||
if hasattr(instance, 'document_type'):
|
||||
document_type = instance.document_type
|
||||
|
||||
|
||||
if document_type:
|
||||
filenames_qs = document_type.documenttypefilename_set.filter(enabled=True)
|
||||
if filenames_qs.count() > 0:
|
||||
@@ -190,7 +190,7 @@ class DocumentForm(forms.ModelForm):
|
||||
new_filename = forms.CharField(
|
||||
label=_('New document filename'), required=False
|
||||
)
|
||||
|
||||
|
||||
|
||||
class DocumentForm_edit(DocumentForm):
|
||||
"""
|
||||
@@ -199,7 +199,7 @@ class DocumentForm_edit(DocumentForm):
|
||||
class Meta:
|
||||
model = Document
|
||||
exclude = ('file', 'document_type', 'tags')
|
||||
|
||||
|
||||
|
||||
class DocumentPropertiesForm(DetailForm):
|
||||
"""
|
||||
|
||||
@@ -32,5 +32,5 @@ class DocumentPageTransformationManager(models.Manager):
|
||||
)
|
||||
except Exception, e:
|
||||
warnings.append(e)
|
||||
|
||||
return transformations, warnings
|
||||
|
||||
return transformations, warnings
|
||||
|
||||
@@ -13,7 +13,7 @@ from taggit.managers import TaggableManager
|
||||
from dynamic_search.api import register
|
||||
from converter.api import get_page_count
|
||||
from converter.api import get_available_transformations_choices
|
||||
from converter.api import create_image_cache_filename, convert
|
||||
from converter.api import convert
|
||||
from converter.exceptions import UnknownFormat, UnkownConvertError
|
||||
|
||||
from documents.utils import get_document_mimetype
|
||||
@@ -21,7 +21,6 @@ from documents.conf.settings import CHECKSUM_FUNCTION
|
||||
from documents.conf.settings import UUID_FUNCTION
|
||||
from documents.conf.settings import STORAGE_BACKEND
|
||||
from documents.conf.settings import PREVIEW_SIZE
|
||||
from documents.conf.settings import THUMBNAIL_SIZE
|
||||
from documents.conf.settings import CACHE_PATH
|
||||
|
||||
from documents.managers import RecentDocumentManager, \
|
||||
@@ -30,8 +29,8 @@ from documents.utils import document_save_to_temp_dir
|
||||
from documents.literals import PICTURE_ERROR_SMALL, PICTURE_ERROR_MEDIUM, \
|
||||
PICTURE_UNKNOWN_SMALL, PICTURE_UNKNOWN_MEDIUM
|
||||
from converter.literals import DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION, \
|
||||
DEFAULT_FILE_FORMAT, DEFAULT_PAGE_NUMBER
|
||||
|
||||
DEFAULT_PAGE_NUMBER
|
||||
|
||||
# document image cache name hash function
|
||||
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
|
||||
|
||||
@@ -63,7 +62,7 @@ class DocumentType(models.Model):
|
||||
class Meta:
|
||||
verbose_name = _(u'document type')
|
||||
verbose_name_plural = _(u'documents types')
|
||||
ordering = ['name']
|
||||
ordering = ['name']
|
||||
|
||||
|
||||
class Document(models.Model):
|
||||
@@ -84,7 +83,7 @@ class Document(models.Model):
|
||||
description = models.TextField(blank=True, null=True, verbose_name=_(u'description'), db_index=True)
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
|
||||
comments = generic.GenericRelation(
|
||||
Comment,
|
||||
content_type_field='content_type',
|
||||
@@ -209,7 +208,7 @@ class Document(models.Model):
|
||||
exists in storage
|
||||
"""
|
||||
return self.file.storage.exists(self.file.path)
|
||||
|
||||
|
||||
def apply_default_transformations(self, transformations):
|
||||
#Only apply default transformations on new documents
|
||||
if reduce(lambda x, y: x + y, [page.documentpagetransformation_set.count() for page in self.documentpage_set.all()]) == 0:
|
||||
@@ -223,7 +222,7 @@ class Document(models.Model):
|
||||
)
|
||||
|
||||
page_transformation.save()
|
||||
|
||||
|
||||
def get_image_cache_name(self, page):
|
||||
document_page = self.documentpage_set.get(page_number=page)
|
||||
transformations, warnings = document_page.get_transformation_list()
|
||||
@@ -234,16 +233,16 @@ class Document(models.Model):
|
||||
else:
|
||||
document_file = document_save_to_temp_dir(self, self.checksum)
|
||||
return convert(document_file, output_filepath=cache_file_path, page=page, transformations=transformations)
|
||||
|
||||
|
||||
def get_image(self, size=PREVIEW_SIZE, page=DEFAULT_PAGE_NUMBER, zoom=DEFAULT_ZOOM_LEVEL, rotation=DEFAULT_ROTATION):
|
||||
try:
|
||||
image_cache_name = self.get_image_cache_name(page=page)
|
||||
output_file = convert(image_cache_name, cleanup_files=False, size=size, zoom=zoom, rotation=rotation)
|
||||
except UnknownFormat:
|
||||
output_file = os.path.join(settings.MEDIA_ROOT, u'images', PICTURE_UNKNOWN_SMALL)
|
||||
except UnkownConvertError:
|
||||
except UnkownConvertError:
|
||||
output_file = os.path.join(settings.MEDIA_ROOT, u'images', PICTURE_ERROR_SMALL)
|
||||
except Exception, e:
|
||||
except:
|
||||
output_file = os.path.join(settings.MEDIA_ROOT, u'images', PICTURE_ERROR_SMALL)
|
||||
return output_file
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.template import Library, Node, Variable
|
||||
|
||||
from converter.api import get_document_dimensions
|
||||
|
||||
from documents.views import calculate_converter_arguments
|
||||
from documents.conf.settings import PRINT_SIZE
|
||||
|
||||
register = Library()
|
||||
|
||||
@@ -59,7 +59,7 @@ urlpatterns = patterns('documents.views',
|
||||
url(r'^type/(?P<document_type_id>\d+)/list/documents/$', 'document_type_document_list', (), 'document_type_document_list'),
|
||||
url(r'^type/(?P<document_type_id>\d+)/edit/$', 'document_type_edit', (), 'document_type_edit'),
|
||||
url(r'^type/(?P<document_type_id>\d+)/delete/$', 'document_type_delete', (), 'document_type_delete'),
|
||||
|
||||
|
||||
url(r'^type/(?P<document_type_id>\d+)/filename/list/$', 'document_type_filename_list', (), 'document_type_filename_list'),
|
||||
url(r'^type/filename/(?P<document_type_filename_id>\d+)/edit/$', 'document_type_filename_edit', (), 'document_type_filename_edit'),
|
||||
url(r'^type/filename/(?P<document_type_filename_id>\d+)/delete/$', 'document_type_filename_delete', (), 'document_type_filename_delete'),
|
||||
|
||||
@@ -46,8 +46,8 @@ def get_document_mimetype(document):
|
||||
library
|
||||
"""
|
||||
file_mimetype = u''
|
||||
file_mime_encoding = u''
|
||||
|
||||
file_mime_encoding = u''
|
||||
|
||||
if USE_PYTHON_MAGIC:
|
||||
if document.exists():
|
||||
try:
|
||||
@@ -62,5 +62,5 @@ def get_document_mimetype(document):
|
||||
source.close()
|
||||
else:
|
||||
file_mimetype, file_mime_encoding = mimetypes.guess_type(document.get_fullname())
|
||||
|
||||
|
||||
return file_mimetype, file_mime_encoding
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
import urlparse
|
||||
import copy
|
||||
|
||||
@@ -10,7 +9,6 @@ from django.contrib import messages
|
||||
from django.views.generic.list_detail import object_list
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.views.generic.create_update import delete_object, update_object
|
||||
from django.conf import settings
|
||||
from django.utils.http import urlencode
|
||||
|
||||
import sendfile
|
||||
@@ -24,8 +22,6 @@ from converter.literals import DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION, \
|
||||
DEFAULT_FILE_FORMAT, DEFAULT_PAGE_NUMBER
|
||||
from filetransfers.api import serve_file
|
||||
from grouping.utils import get_document_group_subtemplate
|
||||
from metadata.api import save_metadata_list, \
|
||||
decode_metadata_from_url, metadata_repr_as_list
|
||||
from metadata.forms import MetadataFormSet, MetadataSelectionForm
|
||||
from navigation.utils import resolve_to_name
|
||||
from permissions.api import check_permissions
|
||||
@@ -33,7 +29,6 @@ from document_indexing.api import update_indexes, delete_indexes
|
||||
from history.api import create_history
|
||||
|
||||
from documents.conf.settings import PREVIEW_SIZE
|
||||
from documents.conf.settings import THUMBNAIL_SIZE
|
||||
from documents.conf.settings import STORAGE_BACKEND
|
||||
from documents.conf.settings import ZOOM_PERCENT_STEP
|
||||
from documents.conf.settings import ZOOM_MAX_LEVEL
|
||||
@@ -52,7 +47,7 @@ from documents.literals import HISTORY_DOCUMENT_CREATED, \
|
||||
HISTORY_DOCUMENT_EDITED, HISTORY_DOCUMENT_DELETED
|
||||
|
||||
from documents.forms import DocumentTypeSelectForm, \
|
||||
DocumentForm, DocumentForm_edit, DocumentPropertiesForm, \
|
||||
DocumentForm_edit, DocumentPropertiesForm, \
|
||||
DocumentPreviewForm, \
|
||||
DocumentPageForm, DocumentPageTransformationForm, \
|
||||
DocumentContentForm, DocumentPageForm_edit, \
|
||||
@@ -61,9 +56,7 @@ from documents.forms import DocumentTypeSelectForm, \
|
||||
from documents.wizards import DocumentCreateWizard
|
||||
from documents.models import Document, DocumentType, DocumentPage, \
|
||||
DocumentPageTransformation, RecentDocument, DocumentTypeFilename
|
||||
from documents.literals import PICTURE_ERROR_SMALL, PICTURE_ERROR_MEDIUM, \
|
||||
PICTURE_UNKNOWN_SMALL, PICTURE_UNKNOWN_MEDIUM
|
||||
|
||||
|
||||
# Document type permissions
|
||||
from documents.literals import PERMISSION_DOCUMENT_TYPE_EDIT, \
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE
|
||||
@@ -446,10 +439,10 @@ def _find_duplicate_list(request, source_document_list=Document.objects.all(), i
|
||||
'hide_links': True,
|
||||
'multi_select_as_buttons': True,
|
||||
}
|
||||
|
||||
|
||||
if extra_context:
|
||||
context.update(extra_context)
|
||||
|
||||
|
||||
return render_to_response('generic_list.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@@ -548,7 +541,7 @@ def document_page_view(request, document_page_id):
|
||||
zoom_text = u'(%d%%)' % zoom
|
||||
else:
|
||||
zoom_text = u''
|
||||
|
||||
|
||||
if rotation != 0 and rotation != 360:
|
||||
rotation_text = u'(%d°)' % rotation
|
||||
else:
|
||||
@@ -779,10 +772,10 @@ def document_hard_copy(request, document_id):
|
||||
|
||||
RecentDocument.objects.add_document_for_user(request.user, document)
|
||||
|
||||
arguments, warnings = calculate_converter_arguments(document, size=PRINT_SIZE, file_format=DEFAULT_FILE_FORMAT)
|
||||
#arguments, warnings = calculate_converter_arguments(document, size=PRINT_SIZE, file_format=DEFAULT_FILE_FORMAT)
|
||||
|
||||
# Pre-generate
|
||||
convert_document(document, **arguments)
|
||||
#convert_document(document, **arguments)
|
||||
|
||||
# Extract dimension values ignoring any unit
|
||||
page_width = request.GET.get('page_width', dict(PAGE_SIZE_DIMENSIONS)[DEFAULT_PAPER_SIZE][0])
|
||||
@@ -828,9 +821,9 @@ def document_type_list(request):
|
||||
|
||||
def document_type_document_list(request, document_type_id):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_VIEW])
|
||||
|
||||
|
||||
document_type = get_object_or_404(DocumentType, pk=document_type_id)
|
||||
|
||||
|
||||
return document_list(
|
||||
request,
|
||||
object_list=Document.objects.filter(document_type=document_type),
|
||||
@@ -867,7 +860,7 @@ def document_type_edit(request, document_type_id):
|
||||
'object_name': _(u'document type'),
|
||||
'next': next
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def document_type_delete(request, document_type_id):
|
||||
@@ -907,7 +900,7 @@ def document_type_delete(request, document_type_id):
|
||||
|
||||
def document_type_create(request):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_TYPE_CREATE])
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
form = DocumentTypeForm(request.POST)
|
||||
if form.is_valid():
|
||||
@@ -948,7 +941,7 @@ def document_type_filename_list(request, document_type_id):
|
||||
}
|
||||
|
||||
return render_to_response('generic_list.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def document_type_filename_edit(request, document_type_filename_id):
|
||||
@@ -982,7 +975,7 @@ def document_type_filename_edit(request, document_type_filename_id):
|
||||
'document_type': document_type_filename.document_type,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
def document_type_filename_delete(request, document_type_filename_id):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_TYPE_EDIT])
|
||||
@@ -1017,14 +1010,14 @@ def document_type_filename_delete(request, document_type_filename_id):
|
||||
}
|
||||
|
||||
return render_to_response('generic_confirm.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def document_type_filename_create(request, document_type_id):
|
||||
check_permissions(request.user, [PERMISSION_DOCUMENT_TYPE_EDIT])
|
||||
|
||||
|
||||
document_type = get_object_or_404(DocumentType, pk=document_type_id)
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
form = DocumentTypeFilenameForm_create(request.POST)
|
||||
if form.is_valid():
|
||||
|
||||
@@ -11,7 +11,7 @@ class SearchForm(forms.Form):
|
||||
required=False,
|
||||
widget=forms.widgets.HiddenInput()
|
||||
)
|
||||
|
||||
|
||||
|
||||
class AdvancedSearchForm(forms.Form):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import urlparse
|
||||
from datetime import datetime
|
||||
|
||||
from django.db import models
|
||||
from django.utils.http import urlencode
|
||||
@@ -12,7 +11,7 @@ class RecentSearchManager(models.Manager):
|
||||
parsed_query = urlparse.parse_qs(query)
|
||||
for key, value in parsed_query.items():
|
||||
parsed_query[key] = u' '.join(value)
|
||||
|
||||
|
||||
if 'q=' in query:
|
||||
# Is a simple query
|
||||
if not parsed_query.get('q'):
|
||||
|
||||
@@ -10,7 +10,7 @@ from django.core.urlresolvers import reverse
|
||||
from dynamic_search.managers import RecentSearchManager
|
||||
from dynamic_search.api import registered_search_dict
|
||||
|
||||
|
||||
|
||||
class RecentSearch(models.Model):
|
||||
"""
|
||||
Keeps a list of the n most recent search keywords for a given user
|
||||
@@ -46,15 +46,15 @@ class RecentSearch(models.Model):
|
||||
def save(self, *args, **kwargs):
|
||||
self.datetime_created = datetime.now()
|
||||
super(RecentSearch, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
def url(self):
|
||||
view = 'results' if self.is_advanced() else 'search'
|
||||
return '%s?%s' % (reverse(view), self.query)
|
||||
|
||||
|
||||
def is_advanced(self):
|
||||
return 'q' not in urlparse.parse_qs(self.query)
|
||||
|
||||
class Meta:
|
||||
ordering = ('-datetime_created',)
|
||||
verbose_name = _(u'recent search')
|
||||
verbose_name_plural = _(u'recent searches')
|
||||
verbose_name_plural = _(u'recent searches')
|
||||
|
||||
@@ -39,10 +39,10 @@ def results(request, extra_context=None):
|
||||
if extra_context:
|
||||
context.update(extra_context)
|
||||
query = urlencode(dict(request.GET.items()))
|
||||
|
||||
|
||||
if query:
|
||||
RecentSearch.objects.add_query_for_user(request.user, query, response['result_count'])
|
||||
|
||||
RecentSearch.objects.add_query_for_user(request.user, query, response['result_count'])
|
||||
|
||||
context.update({
|
||||
'found_entries': response['model_list'],
|
||||
'object_list': response['flat_list'],
|
||||
|
||||
@@ -43,7 +43,7 @@ if not DISABLE_HOME_VIEW:
|
||||
register_top_menu('home', link={'text': _(u'home'), 'view': 'home', 'famfam': 'house'}, position=0)
|
||||
if not SIDE_BAR_SEARCH:
|
||||
register_top_menu('search', link={'text': _(u'search'), 'view': 'search', 'famfam': 'zoom'}, children_path_regex=[r'^search/'])
|
||||
|
||||
|
||||
register_top_menu('tools', link=tools_menu, children_views=['statistics', 'history_list', 'formats_list'])
|
||||
#register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setting_list', 'famfam': 'cog'}, children=setup_views)
|
||||
register_top_menu('setup_menu', link={'text': _(u'setup'), 'view': 'setting_list', 'famfam': 'cog'}, children_path_regex=[r'^settings/', r'^user_management/', r'^permissions', r'^documents/type', r'^metadata/setup', r'sources/setup'])
|
||||
|
||||
@@ -33,14 +33,14 @@ def register_links(src, links, menu_name=None, position=None):
|
||||
if position is not None:
|
||||
for link in reversed(links):
|
||||
object_navigation[menu_name][one_src]['links'].insert(position, link)
|
||||
else:
|
||||
else:
|
||||
object_navigation[menu_name][one_src]['links'].extend(links)
|
||||
else:
|
||||
object_navigation[menu_name].setdefault(src, {'links': []})
|
||||
if position is not None:
|
||||
for link in reversed(links):
|
||||
object_navigation[menu_name][src]['links'].insert(position, link)
|
||||
else:
|
||||
else:
|
||||
object_navigation[menu_name][src]['links'].extend(links)
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ from django.template import TemplateSyntaxError, Library, \
|
||||
from django.utils.text import unescape_string_literal
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django.template import Context
|
||||
|
||||
from common.utils import urlquote
|
||||
|
||||
from navigation.api import object_navigation, multi_object_navigation, \
|
||||
@@ -80,7 +78,7 @@ def resolve_links(context, links, current_view, current_path, parsed_query_strin
|
||||
condition_result = link['condition'](context)
|
||||
else:
|
||||
condition_result = True
|
||||
|
||||
|
||||
if condition_result:
|
||||
new_link = copy.copy(link)
|
||||
try:
|
||||
@@ -106,7 +104,7 @@ def resolve_links(context, links, current_view, current_path, parsed_query_strin
|
||||
elif 'url' in link:
|
||||
if not link.get('dont_mark_active', False):
|
||||
new_link['active'] = link['url'] == current_path
|
||||
|
||||
|
||||
if kwargs:
|
||||
new_link['url'] = link['url'] % kwargs
|
||||
else:
|
||||
@@ -118,24 +116,24 @@ def resolve_links(context, links, current_view, current_path, parsed_query_strin
|
||||
|
||||
if 'conditional_highlight' in link:
|
||||
new_link['active'] = link['conditional_highlight'](context)
|
||||
|
||||
|
||||
if 'conditional_disable' in link:
|
||||
new_link['disabled'] = link['conditional_disable'](context)
|
||||
else:
|
||||
new_link['disabled'] = False
|
||||
|
||||
|
||||
if current_view in link.get('children_views', []):
|
||||
new_link['active'] = True
|
||||
|
||||
for child_url_regex in link.get('children_url_regex', []):
|
||||
if re.compile(child_url_regex).match(current_path.lstrip('/')):
|
||||
new_link['active'] = True
|
||||
|
||||
|
||||
for cls in link.get('children_classes', []):
|
||||
obj, object_name = get_navigation_object(context)
|
||||
if type(obj) == cls or obj == cls:
|
||||
new_link['active'] = True
|
||||
|
||||
|
||||
context_links.append(new_link)
|
||||
return context_links
|
||||
|
||||
@@ -150,9 +148,9 @@ def get_navigation_object(context):
|
||||
obj = Variable(object_name).resolve(context)
|
||||
except VariableDoesNotExist:
|
||||
obj = None
|
||||
|
||||
|
||||
return obj, object_name
|
||||
|
||||
|
||||
|
||||
def _get_object_navigation_links(context, menu_name=None, links_dict=object_navigation):
|
||||
request = Variable('request').resolve(context)
|
||||
@@ -203,7 +201,6 @@ def _get_object_navigation_links(context, menu_name=None, links_dict=object_navi
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
return context_links
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ def run_tesseract(input_filename, lang=None):
|
||||
os.close(fd)
|
||||
ocr_output = os.extsep.join([filepath, u'txt'])
|
||||
command = [unicode(TESSERACT_PATH), unicode(input_filename), unicode(filepath)]
|
||||
|
||||
|
||||
# TODO: Tesseract 3.0 segfaults
|
||||
#if lang is not None:
|
||||
# command.extend([u'-l', lang])
|
||||
@@ -68,15 +68,15 @@ def run_tesseract(input_filename, lang=None):
|
||||
cleanup(filepath)
|
||||
cleanup(ocr_output)
|
||||
raise TesseractError(error_text)
|
||||
|
||||
|
||||
fd = codecs.open(ocr_output, 'r', 'utf-8')
|
||||
text = fd.read().strip()
|
||||
fd.close()
|
||||
|
||||
os.unlink(filepath)
|
||||
|
||||
|
||||
os.unlink(filepath)
|
||||
|
||||
return text
|
||||
|
||||
|
||||
|
||||
def do_document_ocr(queue_document):
|
||||
"""
|
||||
@@ -91,12 +91,12 @@ def do_document_ocr(queue_document):
|
||||
except (ParserError, ParserUnknownFile):
|
||||
# Fall back to doing visual OCR
|
||||
##ocr_transformations, warnings = queue_document.get_transformation_list()
|
||||
|
||||
|
||||
document_filepath = document_page.document.get_image_cache_name(page=document_page.page_number)
|
||||
unpaper_output_filename = u'%s_unpaper_out_page_%s%s%s' % (document_page.document.uuid, document_page.page_number, os.extsep, UNPAPER_FILE_FORMAT)
|
||||
unpaper_output_filepath = os.path.join(TEMPORARY_DIRECTORY, unpaper_output_filename)
|
||||
|
||||
unpaper_input=convert(document_filepath, file_format=UNPAPER_FILE_FORMAT)
|
||||
unpaper_input = convert(document_filepath, file_format=UNPAPER_FILE_FORMAT)
|
||||
execute_unpaper(input_filepath=unpaper_input, output_filepath=unpaper_output_filepath)
|
||||
|
||||
#from PIL import Image, ImageOps
|
||||
@@ -108,7 +108,7 @@ def do_document_ocr(queue_document):
|
||||
#im.save(unpaper_output_filepath)
|
||||
|
||||
# Convert to TIFF
|
||||
pre_ocr_filepath = output_filepath=convert(input_filepath=unpaper_output_filepath, file_format=DEFAULT_OCR_FILE_FORMAT)
|
||||
pre_ocr_filepath = convert(input_filepath=unpaper_output_filepath, file_format=DEFAULT_OCR_FILE_FORMAT)
|
||||
# Tesseract needs an explicit file extension
|
||||
pre_ocr_filepath_w_ext = os.extsep.join([pre_ocr_filepath, DEFAULT_OCR_FILE_EXTENSION])
|
||||
os.rename(pre_ocr_filepath, pre_ocr_filepath_w_ext)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
|
||||
from ocr.models import QueueTransformation
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ class QueueTransformationManager(models.Manager):
|
||||
)
|
||||
except Exception, e:
|
||||
warnings.append(e)
|
||||
|
||||
|
||||
return transformations, warnings
|
||||
|
||||
@@ -48,7 +48,7 @@ class QueueDocument(models.Model):
|
||||
ordering = ('datetime_submitted',)
|
||||
verbose_name = _(u'queue document')
|
||||
verbose_name_plural = _(u'queue documents')
|
||||
|
||||
|
||||
def get_transformation_list(self):
|
||||
return QueueTransformation.objects.get_for_object_as_list(self)
|
||||
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import codecs
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import sys
|
||||
|
||||
import slate
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
@@ -21,14 +15,14 @@ def pdf_parser(document_page):
|
||||
fd = document_page.document.open()
|
||||
pdf_pages = slate.PDF(fd)
|
||||
fd.close()
|
||||
|
||||
|
||||
if pdf_pages[document_page.page_number - 1] == '\x0c':
|
||||
raise ParserError
|
||||
|
||||
|
||||
document_page.content = pdf_pages[document_page.page_number - 1]
|
||||
document_page.page_label = _(u'Text extracted from PDF')
|
||||
document_page.save()
|
||||
|
||||
|
||||
|
||||
def parse_document_page(document_page):
|
||||
try:
|
||||
@@ -36,5 +30,5 @@ def parse_document_page(document_page):
|
||||
except KeyError:
|
||||
raise ParserUnknownFile
|
||||
|
||||
|
||||
|
||||
register_parser('application/pdf', pdf_parser)
|
||||
|
||||
@@ -13,10 +13,9 @@ urlpatterns = patterns('ocr.views',
|
||||
|
||||
url(r'^document/all/clean_up/$', 'all_document_ocr_cleanup', (), 'all_document_ocr_cleanup'),
|
||||
url(r'^node/active/list/$', 'node_active_list', (), 'node_active_list'),
|
||||
|
||||
|
||||
url(r'^queue/(?P<document_queue_id>\d+)/transformation/list/$', 'setup_queue_transformation_list', (), 'setup_queue_transformation_list'),
|
||||
url(r'^queue/(?P<document_queue_id>\w+)/transformation/create/$', 'setup_queue_transformation_create', (), 'setup_queue_transformation_create'),
|
||||
url(r'^queue/transformation/(?P<transformation_id>\w+)/edit/$', 'setup_queue_transformation_edit', (), 'setup_queue_transformation_edit'),
|
||||
url(r'^queue/transformation/(?P<transformation_id>\w+)/delete/$', 'setup_queue_transformation_delete', (), 'setup_queue_transformation_delete'),
|
||||
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@ def queue_document_list(request, queue_name='default'):
|
||||
'queue': document_queue,
|
||||
'object_name': _(u'document queue'),
|
||||
'navigation_object_name': 'queue',
|
||||
'list_object_variable_name': 'queue_document',
|
||||
'list_object_variable_name': 'queue_document',
|
||||
'extra_columns': [
|
||||
{'name': 'document', 'attribute': lambda x: document_link(x.document) if hasattr(x, 'document') else _(u'Missing document.')},
|
||||
{'name': _(u'thumbnail'), 'attribute': lambda x: document_thumbnail(x.document)},
|
||||
@@ -325,7 +325,7 @@ def node_active_list(request):
|
||||
|
||||
def setup_queue_transformation_list(request, document_queue_id):
|
||||
#check_permissions(request.user, [PERMISSION_SOURCES_SETUP_EDIT])
|
||||
|
||||
|
||||
document_queue = get_object_or_404(DocumentQueue, pk=document_queue_id)
|
||||
|
||||
context = {
|
||||
@@ -336,7 +336,7 @@ def setup_queue_transformation_list(request, document_queue_id):
|
||||
'queue': document_queue,
|
||||
'object_name': _(u'document queue'),
|
||||
'navigation_object_name': 'queue',
|
||||
'list_object_variable_name': 'transformation',
|
||||
'list_object_variable_name': 'transformation',
|
||||
'extra_columns': [
|
||||
{'name': _(u'order'), 'attribute': 'order'},
|
||||
{'name': _(u'transformation'), 'attribute': lambda x: x.get_transformation_display()},
|
||||
@@ -347,12 +347,12 @@ def setup_queue_transformation_list(request, document_queue_id):
|
||||
}
|
||||
|
||||
return render_to_response('generic_list.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def setup_queue_transformation_edit(request, transformation_id):
|
||||
#check_permissions(request.user, [PERMISSION_SOURCES_SETUP_EDIT])
|
||||
|
||||
|
||||
transformation = get_object_or_404(QueueTransformation, pk=transformation_id)
|
||||
redirect_view = reverse('setup_queue_transformation_list', args=[transformation.content_object.pk])
|
||||
next = request.POST.get('next', request.GET.get('next', request.META.get('HTTP_REFERER', redirect_view)))
|
||||
@@ -386,7 +386,7 @@ def setup_queue_transformation_edit(request, transformation_id):
|
||||
],
|
||||
'next': next,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def setup_queue_transformation_delete(request, transformation_id):
|
||||
@@ -413,24 +413,23 @@ def setup_queue_transformation_delete(request, transformation_id):
|
||||
'navigation_object_list': [
|
||||
{'object': 'queue', 'name': _(u'document queue')},
|
||||
{'object': 'transformation', 'name': _(u'transformation')}
|
||||
],
|
||||
],
|
||||
'title': _(u'Are you sure you wish to delete queue transformation "%(transformation)s"') % {
|
||||
'transformation': transformation.get_transformation_display(),
|
||||
},
|
||||
'previous': previous,
|
||||
'form_icon': u'shape_square_delete.png',
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def setup_queue_transformation_create(request, document_queue_id):
|
||||
#check_permissions(request.user, [PERMISSION_SOURCES_SETUP_EDIT])
|
||||
|
||||
document_queue = get_object_or_404(DocumentQueue, pk=document_queue_id)
|
||||
|
||||
|
||||
redirect_view = reverse('setup_queue_transformation_list', args=[document_queue.pk])
|
||||
previous = request.POST.get('previous', request.GET.get('previous', request.META.get('HTTP_REFERER', redirect_view)))
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
form = QueueTransformationForm_create(request.POST)
|
||||
if form.is_valid():
|
||||
@@ -439,7 +438,7 @@ def setup_queue_transformation_create(request, document_queue_id):
|
||||
eval(form.cleaned_data['arguments'], {})
|
||||
except:
|
||||
messages.error(request, _(u'Queue transformation argument error.'))
|
||||
else:
|
||||
else:
|
||||
try:
|
||||
queue_tranformation = form.save(commit=False)
|
||||
queue_tranformation.content_object = document_queue
|
||||
@@ -450,7 +449,7 @@ def setup_queue_transformation_create(request, document_queue_id):
|
||||
messages.error(request, _(u'Error creating queue transformation; %s') % e)
|
||||
else:
|
||||
form = QueueTransformationForm_create()
|
||||
|
||||
|
||||
return render_to_response('generic_form.html', {
|
||||
'form': form,
|
||||
'queue': document_queue,
|
||||
@@ -458,4 +457,3 @@ def setup_queue_transformation_create(request, document_queue_id):
|
||||
'navigation_object_name': 'queue',
|
||||
'title': _(u'Create new transformation for queue: %s') % document_queue,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.template import RequestContext
|
||||
|
||||
@@ -4,7 +4,6 @@ from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.contenttypes import generic
|
||||
|
||||
from documents.models import DocumentType
|
||||
from documents.managers import RecentDocumentManager
|
||||
from metadata.models import MetadataType
|
||||
from converter.api import get_available_transformations_choices
|
||||
from converter.literals import DIMENSION_SEPARATOR
|
||||
|
||||
@@ -5,7 +5,6 @@ import hashlib
|
||||
from django.core.files.base import File
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.utils.translation import ugettext
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from converter.api import convert, cache_cleanup
|
||||
|
||||
@@ -595,25 +595,8 @@ def setup_source_transformation_create(request, source_type, source_id):
|
||||
cls = StagingFolder
|
||||
|
||||
source = get_object_or_404(cls, pk=source_id)
|
||||
|
||||
context = {
|
||||
'object_list': SourceTransformation.objects.get_for_object(source),
|
||||
'title': _(u'transformations for: %s') % source.fullname(),
|
||||
'source': source,
|
||||
'object_name': _(u'source'),
|
||||
'navigation_object_name': 'source',
|
||||
'list_object_variable_name': 'transformation',
|
||||
'extra_columns': [
|
||||
{'name': _(u'order'), 'attribute': 'order'},
|
||||
{'name': _(u'transformation'), 'attribute': lambda x: x.get_transformation_display()},
|
||||
{'name': _(u'arguments'), 'attribute': 'arguments'}
|
||||
],
|
||||
'hide_link': True,
|
||||
'hide_object': True,
|
||||
}
|
||||
|
||||
|
||||
redirect_view = reverse('setup_source_transformation_list', args=[source.source_type, source.pk])
|
||||
previous = request.POST.get('previous', request.GET.get('previous', request.META.get('HTTP_REFERER', redirect_view)))
|
||||
|
||||
if request.method == 'POST':
|
||||
form = SourceTransformationForm_create(request.POST)
|
||||
|
||||
@@ -3,7 +3,6 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from navigation.api import register_links, register_top_menu, \
|
||||
register_model_list_columns, register_multi_item_links
|
||||
from permissions.api import register_permission, set_namespace_title
|
||||
from navigation.api import register_sidebar_template
|
||||
|
||||
from documents.models import Document
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ def tag_add_attach(request, document_id):
|
||||
document = get_object_or_404(Document, pk=document_id)
|
||||
|
||||
next = request.POST.get('next', request.GET.get('next', request.META.get('HTTP_REFERER', reverse('document_tags', args=[document.pk]))))
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
form = AddTagForm(request.POST)
|
||||
if form.is_valid():
|
||||
@@ -97,14 +97,14 @@ def tag_add_attach(request, document_id):
|
||||
return HttpResponseRedirect(next)
|
||||
else:
|
||||
form = AddTagForm()
|
||||
|
||||
|
||||
return render_to_response('generic_form.html', {
|
||||
'title': _(u'attach tag to: %s') % document,
|
||||
'form': form,
|
||||
'object': document,
|
||||
'next': next,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def tag_list(request):
|
||||
@@ -222,7 +222,7 @@ def tag_tagged_item_list(request, tag_id):
|
||||
def document_tags(request, document_id):
|
||||
check_permissions(request.user, [PERMISSION_TAG_VIEW])
|
||||
document = get_object_or_404(Document, pk=document_id)
|
||||
|
||||
|
||||
return render_to_response('generic_list.html', {
|
||||
'title': _(u'tags for: %s') % document,
|
||||
'object_list': document.tags.all(),
|
||||
@@ -265,7 +265,7 @@ def tag_remove(request, document_id, tag_id=None, tag_id_list=None):
|
||||
})
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
|
||||
context = {
|
||||
'previous': previous,
|
||||
'next': next,
|
||||
@@ -284,4 +284,3 @@ def tag_remove(request, document_id, tag_id=None, tag_id_list=None):
|
||||
|
||||
def tag_multiple_remove(request, document_id):
|
||||
return tag_remove(request, document_id=document_id, tag_id_list=request.GET.get('id_list', []))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user