Skip to content

Commit f897c59

Browse files
authored
feat: add instance list to compound root file. (#57)
1 parent 74eeef3 commit f897c59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sdk/diffgram/file/compound_file.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ class CompoundFile:
107107
project: Project
108108
parent_file_data: dict
109109
child_files: List[CompoundChildFile]
110+
instance_list: List[dict]
110111

111-
def __init__(self, project: Project, name: str, directory_id: int):
112+
def __init__(self, project: Project, name: str, directory_id: int, instance_list: List[dict] = []):
112113
self.project = project
113114
self.name = name
114115
self.directory_id = directory_id
115116
self.child_files = []
117+
self.instance_list = instance_list
116118

117119
@staticmethod
118120
def from_dict(project: Project, dir_id: int, dict_data: dict):
@@ -162,7 +164,8 @@ def __create_compound_parent_file(self):
162164
url = f'/api/v1/project/{self.project.project_string_id}/file/new-compound'
163165
data = {
164166
'name': self.name,
165-
'directory_id': self.directory_id
167+
'directory_id': self.directory_id,
168+
'instance_list': self.instance_list
166169
}
167170
response = self.project.session.post(url = self.project.host + url,
168171
json = data)

0 commit comments

Comments
 (0)