def get_subpages_sorted(self, pages, page):
sorted_pages = []<EOL>to_sort = []<EOL>for subpage in page.subpages:<EOL><INDENT>if pages[subpage].pre_sorted:<EOL><INDENT>sorted_pages.append(subpage)<EOL><DEDENT>else:<EOL><INDENT>to_sort.append(subpage)<EOL><DEDENT><DEDENT>return sorted_pages + sorted(<EOL>to_sort, key=lambda p: pages[p].get_title().lower())<EOL>
Get @page subpages sorted appropriately.