83
83
TAGS ,
84
84
TEMPLATE ,
85
85
LATEST_REVS ,
86
+ LATEST_META ,
86
87
EDIT_ROWS ,
87
88
FQNAMES ,
88
89
USERGROUP ,
@@ -1186,7 +1187,6 @@ def handle_variables(self, data, meta):
1186
1187
@rtype: string
1187
1188
@return: new text of wikipage, variables replaced
1188
1189
"""
1189
- logging .debug (f"handle_variable data: { data !r} " )
1190
1190
if self .contenttype not in CONTENTTYPE_VARIABLES :
1191
1191
return data
1192
1192
if "@" not in data :
@@ -1196,6 +1196,7 @@ def handle_variables(self, data, meta):
1196
1196
if TEMPLATE in meta ["tags" ]:
1197
1197
return data
1198
1198
1199
+ logging .debug (f"handle_variable data: { data !r} " ) # log only if necessary
1199
1200
item_name = request .path .split ("/" , 2 )[- 1 ]
1200
1201
signature = flaskg .user .name0 if flaskg .user .valid else request .remote_addr
1201
1202
@@ -1356,7 +1357,7 @@ def build_index_query(self, startswith=None, selected_groups=None, isglobalindex
1356
1357
1357
1358
return query
1358
1359
1359
- def get_index (self , startswith = None , selected_groups = None , regex = None ):
1360
+ def get_index (self , startswith = None , selected_groups = None , regex = None , short = False ):
1360
1361
"""
1361
1362
Get index enties for descendents of the matching items
1362
1363
@@ -1371,11 +1372,12 @@ def get_index(self, startswith=None, selected_groups=None, regex=None):
1371
1372
- one for "dirs" (direct descendents that also contain descendents)
1372
1373
"""
1373
1374
fqname = self .fqname
1375
+ idx_name = LATEST_META if short else LATEST_REVS
1374
1376
isglobalindex = not fqname .value or fqname .value == NAMESPACE_ALL
1375
1377
query = self .build_index_query (startswith , selected_groups , isglobalindex )
1376
1378
if not fqname .value .startswith (NAMESPACE_ALL + "/" ) and fqname .value != NAMESPACE_ALL :
1377
1379
query = Term (NAMESPACE , fqname .namespace ) & query
1378
- revs = flaskg .storage .search_meta (query , idx_name = LATEST_REVS , sortedby = NAME_EXACT , limit = None , regex = regex )
1380
+ revs = flaskg .storage .search_meta (query , idx_name = idx_name , sortedby = NAME_EXACT , limit = None , regex = regex )
1379
1381
return self .make_flat_index (revs , isglobalindex )
1380
1382
1381
1383
0 commit comments