Skip to content

Commit da13b93

Browse files
Add file type to creating compound file
1 parent 74eeef3 commit da13b93

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdk/diffgram/file/compound_file.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,12 @@ class CompoundFile:
108108
parent_file_data: dict
109109
child_files: List[CompoundChildFile]
110110

111-
def __init__(self, project: Project, name: str, directory_id: int):
111+
def __init__(self, project: Project, name: str, directory_id: int, type: str = 'compound'):
112112
self.project = project
113113
self.name = name
114114
self.directory_id = directory_id
115115
self.child_files = []
116+
self.type = type
116117

117118
@staticmethod
118119
def from_dict(project: Project, dir_id: int, dict_data: dict):
@@ -162,7 +163,8 @@ def __create_compound_parent_file(self):
162163
url = f'/api/v1/project/{self.project.project_string_id}/file/new-compound'
163164
data = {
164165
'name': self.name,
165-
'directory_id': self.directory_id
166+
'directory_id': self.directory_id,
167+
'type': self.type
166168
}
167169
response = self.project.session.post(url = self.project.host + url,
168170
json = data)

0 commit comments

Comments
 (0)