Skip to content

Commit

Permalink
Merge pull request #58 from diffgram/add-type-to-compound-creation
Browse files Browse the repository at this point in the history
Add file type to creating compound file
  • Loading branch information
vitalii-bulyzhyn committed Feb 22, 2023
2 parents 8791e4b + 48061a5 commit d14a1ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/diffgram/file/compound_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ class CompoundFile:
child_files: List[CompoundChildFile]
instance_list: List[dict]

def __init__(self, project: Project, name: str, directory_id: int, instance_list: List[dict] = []):
def __init__(self, project: Project, name: str, directory_id: int, instance_list: List[dict] = [], file_type: str = 'compound'):
self.project = project
self.name = name
self.directory_id = directory_id
self.child_files = []
self.instance_list = instance_list
self.type = file_type

@staticmethod
def from_dict(project: Project, dir_id: int, dict_data: dict):
Expand Down Expand Up @@ -166,7 +167,8 @@ def __create_compound_parent_file(self):
data = {
'name': self.name,
'directory_id': self.directory_id,
'instance_list': self.instance_list
'instance_list': self.instance_list,
'type': self.type
}
response = self.project.session.post(url = self.project.host + url,
json = data)
Expand Down

0 comments on commit d14a1ed

Please sign in to comment.