Creating Attachments Field in a Custom Entity

Hey all…!
I am new to shotgrid and I am trying to create a field in a custom entity where multiple attachments can be linked. I have configured my field as ‘Multi-Entity’ with Link to entity type as ‘File’, just like how the ‘Attachments’ field in ‘Note’ entity is configured. Below is the code I am using to upload attachments and linking it to my field.

my_list = list()
for f in myfiles: #myfiles is a list consisting of path to files
my_dict = dict()
my_dict[‘type’] = ‘Attachment’
my_dict[‘id’] = sg_obj.upload(‘CustomEntity01’, <ID of my custom entity’s record>, f, display_name=os.path.basename(f))
my_list.append(my_dict)

sg_obj.update(‘CustomEntity01’, <ID of my custom entity’s record>, {‘sg_attachments’: my_list})

With above code, I am able to find my uploads in File entity and is also displayed in field ‘sg_attachments’, but the attachments are not coming as a link which can be downloaded when I click on it, just like how it gets opened/downloaded when I click on any attachment in ‘Attachments’ fields of ‘Note’ entity.

Additionally, I don’t have to use update() method when it comes to ‘Note’ entity. Just the upload() method is enough for all attachments to be displayed under ‘Attachments’ field in ‘Note’ entity. Please let me know if by any way I can achieve the same for my custom entity.