Add and exclude Index instance columns
Exclude inherited columns from the Index models. Add the label columns to Index instances. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -100,17 +100,24 @@ class DocumentIndexingApp(MayanAppConfig):
|
|||||||
model=IndexInstanceNode, related='index_template_node__index'
|
model=IndexInstanceNode, related='index_template_node__index'
|
||||||
)
|
)
|
||||||
|
|
||||||
SourceColumn(
|
column_index_label = SourceColumn(
|
||||||
attribute='label', is_identifier=True, is_sortable=True,
|
attribute='label', is_identifier=True, is_sortable=True,
|
||||||
source=Index
|
source=Index
|
||||||
)
|
)
|
||||||
|
column_index_label.add_exclude(source=IndexInstance)
|
||||||
SourceColumn(
|
SourceColumn(
|
||||||
|
attribute='label', is_object_absolute_url=True, is_identifier=True,
|
||||||
|
is_sortable=True, source=IndexInstance
|
||||||
|
)
|
||||||
|
column_index_slug = SourceColumn(
|
||||||
attribute='slug', is_sortable=True, source=Index
|
attribute='slug', is_sortable=True, source=Index
|
||||||
)
|
)
|
||||||
SourceColumn(
|
column_index_slug.add_exclude(IndexInstance)
|
||||||
|
column_index_enabled = SourceColumn(
|
||||||
attribute='enabled', is_sortable=True, source=Index,
|
attribute='enabled', is_sortable=True, source=Index,
|
||||||
widget=TwoStateWidget
|
widget=TwoStateWidget
|
||||||
)
|
)
|
||||||
|
column_index_enabled.add_exclude(source=IndexInstance)
|
||||||
|
|
||||||
SourceColumn(
|
SourceColumn(
|
||||||
func=lambda context: context[
|
func=lambda context: context[
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ class IndexListView(SingleObjectListView):
|
|||||||
|
|
||||||
def get_extra_context(self):
|
def get_extra_context(self):
|
||||||
return {
|
return {
|
||||||
|
'hide_object': True,
|
||||||
'hide_links': True,
|
'hide_links': True,
|
||||||
'no_results_icon': icon_index,
|
'no_results_icon': icon_index,
|
||||||
'no_results_main_link': link_index_template_create.resolve(
|
'no_results_main_link': link_index_template_create.resolve(
|
||||||
|
|||||||
Reference in New Issue
Block a user