Cleanup SourceColumn invocations

Update the code of some SourceColumn invocations to be model methods
instead of lambda wapped functions.

Move the translated labels to the models too.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-21 23:47:14 -04:00
parent 5623f0b3a4
commit 213f3c1fb4
7 changed files with 109 additions and 104 deletions

View File

@@ -77,9 +77,9 @@ def document_link(document):
)
def widget_document_page_number(document):
return mark_safe(s=_('Pages: %d') % document.pages.count())
def widget_document_page_number(context):
return context['object'].pages.count()
def widget_document_version_page_number(document_version):
return mark_safe(s=_('Pages: %d') % document_version.pages.count())
def widget_document_version_page_number(context):
return context['object'].pages.count()