Add widget support to SourceColumn
Allow passing a widget class to SourceColumn. This makes using lambdas to render model column unnecesary and are mostly removed too. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -20,7 +20,6 @@ from mayan.apps.common.generics import (
|
||||
SingleObjectDownloadView, SingleObjectEditView, SingleObjectListView
|
||||
)
|
||||
from mayan.apps.common.mixins import MultipleInstanceActionMixin
|
||||
from mayan.apps.common.utils import encapsulate
|
||||
from mayan.apps.converter.models import Transformation
|
||||
from mayan.apps.converter.permissions import (
|
||||
permission_transformation_delete, permission_transformation_edit
|
||||
@@ -259,12 +258,7 @@ class DocumentDuplicatesListView(DocumentListView):
|
||||
return context
|
||||
|
||||
def get_object_list(self):
|
||||
try:
|
||||
return DuplicatedDocument.objects.get(
|
||||
document=self.get_document()
|
||||
).documents.all()
|
||||
except DuplicatedDocument.DoesNotExist:
|
||||
return Document.objects.none()
|
||||
return self.get_document().get_duplicates()
|
||||
|
||||
|
||||
class DocumentEditView(SingleObjectEditView):
|
||||
@@ -842,16 +836,6 @@ class DuplicatedDocumentListView(DocumentListView):
|
||||
context = super(DuplicatedDocumentListView, self).get_extra_context()
|
||||
context.update(
|
||||
{
|
||||
'extra_columns': (
|
||||
{
|
||||
'name': _('Duplicates'),
|
||||
'attribute': encapsulate(
|
||||
lambda document: DuplicatedDocument.objects.get(
|
||||
document=document
|
||||
).documents.count()
|
||||
)
|
||||
},
|
||||
),
|
||||
'no_results_icon': icon_duplicated_document_list,
|
||||
'no_results_text': _(
|
||||
'Duplicates are documents that are composed of the exact '
|
||||
|
||||
Reference in New Issue
Block a user