Skip to content
Snippets Groups Projects
Commit b4c0c588 authored by Frank Duncan's avatar Frank Duncan
Browse files

Add subcolumn accessor for tocs

parent 965fb114
No related branches found
No related tags found
No related merge requests found
......@@ -292,6 +292,16 @@ class GenericToc(Toc):
def format(self, proposal_name, output_name):
return '{%%- set %s = %s["%s"] %%}\n' % (output_name, proposal_name, self.column_name)
class SubColumnAccessor(ColumnAccessor):
def __init__(self, column_names):
self.column_names = column_names
def format(self, proposal_name, output_name):
subselect = ""
for column_name in self.column_names:
subselect = subselect + '["%s"]' % column_name
return '{%%- set %s = [%s%s] %%}\n' % (output_name, proposal_name, subselect)
class SortMethod(Enum):
NONE = TocSorter(None, None)
NAME = TocSorter("name", False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment