Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add instance list to compound root file.
  • Loading branch information
PJEstrada committed Feb 14, 2023
commit cc320fc4ebe0e8a6a4b7d5c83611eadd6d666a20
7 changes: 5 additions & 2 deletions sdk/diffgram/file/compound_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ class CompoundFile:
project: Project
parent_file_data: dict
child_files: List[CompoundChildFile]
instance_list: List[dict]

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

@staticmethod
def from_dict(project: Project, dir_id: int, dict_data: dict):
Expand Down Expand Up @@ -162,7 +164,8 @@ def __create_compound_parent_file(self):
url = f'/api/v1/project/{self.project.project_string_id}/file/new-compound'
data = {
'name': self.name,
'directory_id': self.directory_id
'directory_id': self.directory_id,
'instance_list': self.instance_list
}
response = self.project.session.post(url = self.project.host + url,
json = data)
Expand Down