Make the index instance level column sortable

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-29 01:34:38 -04:00
parent 6a8b062be7
commit b1e464f52f

View File

@@ -138,12 +138,14 @@ class DocumentIndexingApp(MayanAppConfig):
) )
SourceColumn( SourceColumn(
func=lambda context: index_instance_item_link(context['object']), func=lambda context: index_instance_item_link(context['object']),
label=_('Level'), source=IndexInstanceNode label=_('Level'), is_sortable=True, sort_field='value',
source=IndexInstanceNode
) )
SourceColumn( SourceColumn(
func=lambda context: context['object'].get_descendants_count(), func=lambda context: context['object'].get_descendants_count(),
label=_('Levels'), source=IndexInstanceNode label=_('Levels'), source=IndexInstanceNode
) )
SourceColumn( SourceColumn(
func=lambda context: context[ func=lambda context: context[
'object' 'object'
@@ -155,7 +157,8 @@ class DocumentIndexingApp(MayanAppConfig):
SourceColumn( SourceColumn(
func=lambda context: get_instance_link( func=lambda context: get_instance_link(
index_instance_node=context['object'], index_instance_node=context['object'],
), label=_('Level'), source=DocumentIndexInstanceNode ), label=_('Level'), is_sortable=True, sort_field='value',
source=DocumentIndexInstanceNode
) )
SourceColumn( SourceColumn(
func=lambda context: context['object'].get_descendants_count(), func=lambda context: context['object'].get_descendants_count(),