Skip to content

Commit 7b7885a

Browse files
authored
Find a list of Child id/title (#546)
* Add get_parent_content_title func * add get child id/title func
1 parent 34f0025 commit 7b7885a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

atlassian/confluence.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,33 @@ def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):
8585

8686
return response.get('results')
8787

88+
def get_child_title_list(self, page_id, type='page', start=None, limit=None):
89+
"""
90+
Find a list of Child title
91+
:param page_id: A string containing the id of the type content container.
92+
:param type:
93+
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
94+
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
95+
:return:
96+
"""
97+
child_page = self.get_page_child_by_type(page_id, type, start, limit)
98+
child_title_list = [child['title'] for child in child_page]
99+
return child_title_list
100+
101+
def get_child_id_list(self, page_id, type='page', start=None, limit=None):
102+
"""
103+
Find a list of Child id
104+
:param page_id: A string containing the id of the type content container.
105+
:param type:
106+
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
107+
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
108+
:return:
109+
"""
110+
child_page = self.get_page_child_by_type(page_id, type, start, limit)
111+
child_id_list = [child['id'] for child in child_page]
112+
return child_id_list
113+
114+
88115
def get_child_pages(self, page_id):
89116
"""
90117
Get child pages for the provided page_id

0 commit comments

Comments
 (0)