@@ -107,8 +107,8 @@ def report_download(context, request):
107
107
request .GET ['limit' ] = 'all'
108
108
type_str = types [0 ]
109
109
schema = request .registry [TYPES ][type_str ].schema
110
- search_config = request .registry [SEARCH_CONFIG ]. as_dict ()[ type_str ]
111
- columns = list_visible_columns_for_schemas (request , schema , search_config )
110
+ search_configs = request .registry ['SEARCH_CONFIG_REPORT_CLIENT' ]. get ( type_str )
111
+ columns = list_visible_columns_for_schemas (request , schema , search_configs )
112
112
snake_type = _convert_camel_to_snake (type_str ).replace ("'" , '' )
113
113
results = search_generator (request )
114
114
@@ -143,13 +143,17 @@ def generate_rows():
143
143
return request .response
144
144
145
145
146
- def list_visible_columns_for_schemas (request , schema , search_config ):
146
+ def list_visible_columns_for_schemas (request , schema , search_configs ):
147
147
"""
148
148
Returns mapping of default columns for a set of schemas.
149
149
"""
150
150
columns = OrderedDict ({'@id' : {'title' : 'ID' }})
151
- if 'columns' in search_config :
152
- columns .update (search_config ['columns' ])
151
+ collected_columns = OrderedDict ()
152
+ for config in search_configs :
153
+ if 'columns' in config :
154
+ collected_columns .update (config ['columns' ])
155
+ if collected_columns :
156
+ columns .update (collected_columns )
153
157
else :
154
158
# default columns if not explicitly specified
155
159
columns .update (OrderedDict (
@@ -265,10 +269,13 @@ def get_result_columns(request, facets, report_response_columns):
265
269
else :
266
270
for type_str in types_in_search_result :
267
271
schema = request .registry [TYPES ][type_str ].schema
268
- search_config = request .registry [SEARCH_CONFIG ].as_dict ()[type_str ]
269
-
270
- if 'columns' in search_config :
271
- columns .update (search_config ['columns' ])
272
+ search_configs = request .registry ['SEARCH_CONFIG_REPORT_CLIENT' ].get (type_str )
273
+ collected_columns = OrderedDict ()
274
+ for config in search_configs :
275
+ if 'columns' in config :
276
+ collected_columns .update (config ['columns' ])
277
+ if collected_columns :
278
+ columns .update (collected_columns )
272
279
else :
273
280
# default columns if not explicitly specified
274
281
columns .update (OrderedDict (
0 commit comments