Skip to content

Commit d14a1ed

Browse files
Merge pull request #58 from diffgram/add-type-to-compound-creation
Add file type to creating compound file
2 parents 8791e4b + 48061a5 commit d14a1ed

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
@@ -109,12 +109,13 @@ class CompoundFile:
109109
child_files: List[CompoundChildFile]
110110
instance_list: List[dict]
111111

112-
def __init__(self, project: Project, name: str, directory_id: int, instance_list: List[dict] = []):
112+
def __init__(self, project: Project, name: str, directory_id: int, instance_list: List[dict] = [], file_type: str = 'compound'):
113113
self.project = project
114114
self.name = name
115115
self.directory_id = directory_id
116116
self.child_files = []
117117
self.instance_list = instance_list
118+
self.type = file_type
118119

119120
@staticmethod
120121
def from_dict(project: Project, dir_id: int, dict_data: dict):
@@ -166,7 +167,8 @@ def __create_compound_parent_file(self):
166167
data = {
167168
'name': self.name,
168169
'directory_id': self.directory_id,
169-
'instance_list': self.instance_list
170+
'instance_list': self.instance_list,
171+
'type': self.type
170172
}
171173
response = self.project.session.post(url = self.project.host + url,
172174
json = data)

0 commit comments

Comments
 (0)