Thanks for pointing a few things out that I seem to have overlooked. The freezing up, ended up being due to wrong formatting and an incorrect unique id for the custom string template - now sourced correctly using the following code: template = dropbox.file_properties.PropertyFieldTemplate(name="MyTemplate", description="description",type=dropbox.file_properties.PropertyType.string)
my_template_id = dbx.file_properties_templates_add_for_user("MyTemplate","description",[template]).template_id
data = dropbox.file_properties.PropertyField(name='MyTemplate', value='foobar') Regarding the PropertyFieldTemplate the available types seems to be either 'string' or 'other'. Just curious, how you would use the PropertyType 'other' to store data? Can property group data be altered on uploaded files or does it have to be added as part an upload process?
... View more
Hello! I've just started using the Dropbox Python API, but am a bit confused on how to add custom metadata to new or exists files. I've tried to defined my own PropertyGroup with the data stored in a PropertyField (as shown in the code below). However, passing this as a parameter of dbx.files_upload() causes the process to freezes up. Should the template_id of the property group be defined differently? data = dropbox.file_properties.PropertyField('foo', 'bar')
my_property_group = dropbox.file_properties.PropertyGroup()
my_property_group .template_id = '/|test_template'
my_property_group .fields = [data]
with open(r'C:\test_file.txt', "rb") as f:
dbx.files_upload(f.read(), '/test_file.txt', mute = True, property_groups=[my_property_group ]) Any help on this would be much appreciated!
... View more