@@ -42,6 +42,14 @@ create
4242 :param string description: (optional). Product description.
4343 :param list tag_list: (optional). List of tags.
4444 :param list custom_fields: (optional). Custom fields as [{'id': 1, 'value': 'foo'}].
45+ :param dict image:
46+ .. raw :: html
47+
48+ (optional). Image to be used for the product as dict, accepted keys are:
49+
50+ - path (required). Absolute file path or file-like object that should be uploaded.
51+ - filename (optional). Required if a file-like object is provided.
52+
4553 :param list uploads:
4654 .. raw :: html
4755
6775 ... description = ' product description' ,
6876 ... tag_list = [' foo' , ' bar' ],
6977 ... custom_fields = [{' id' : 1 , ' value' : ' 11' }],
78+ ... image = {' path' : ' /absolute/path/to/file.jpg' },
7079 ... uploads = [{' path' : ' /absolute/path/to/file' }, {' path' : BytesIO(b ' I am content of file 2' )}]
7180 ... )
7281 >> > product
98107 >> > product.description = ' product description'
99108 >> > product.tag_list = [' foo' , ' bar' ]
100109 >> > product.custom_fields = [{' id' : 1 , ' value' : ' 11' }]
110+ >> > product.image = {' path' : ' /absolute/path/to/file.jpg' }
101111 >> > product.uploads = [{' path' : ' /absolute/path/to/file' }, {' path' : BytesIO(b ' I am content of file 2' )}]
102112 >> > product.save()
103113 < redminelib.resources.Product # 123>
@@ -251,6 +261,14 @@ update
251261 :param string description: (optional). Product description.
252262 :param list tag_list: (optional). List of tags.
253263 :param list custom_fields: (optional). Custom fields as [{'id': 1, 'value': 'foo'}].
264+ :param dict image:
265+ .. raw :: html
266+
267+ (optional). Image to be used for the product as dict, accepted keys are:
268+
269+ - path (required). Absolute file path or file-like object that should be uploaded.
270+ - filename (optional). Required if a file-like object is provided.
271+
254272 :param list uploads:
255273 .. raw :: html
256274
@@ -277,6 +295,7 @@ update
277295 ... description = ' product description' ,
278296 ... tag_list = [' foo' , ' bar' ],
279297 ... custom_fields = [{' id' : 1 , ' value' : ' 11' }],
298+ ... image = {' path' : ' /absolute/path/to/file.jpg' },
280299 ... uploads = [{' path' : ' /absolute/path/to/file' }, {' path' : BytesIO(b ' I am content of file 2' )}]
281300 ... )
282301 True
306325 >> > product.description = ' product description'
307326 >> > product.tag_list = [' foo' , ' bar' ]
308327 >> > product.custom_fields = [{' id' : 1 , ' value' : ' 11' }]
328+ >> > product.image = {' path' : ' /absolute/path/to/file.jpg' }
309329 >> > product.uploads = [{' path' : ' /absolute/path/to/file' }, {' path' : BytesIO(b ' I am content of file 2' )}]
310330 >> > product.save()
311331 < redminelib.resources.Product # 123>
325345 ... description = ' product description' ,
326346 ... tag_list = [' foo' , ' bar' ],
327347 ... custom_fields = [{' id' : 1 , ' value' : ' 11' }],
348+ ... image = {' path' : ' /absolute/path/to/file.jpg' },
328349 ... uploads = [{' path' : ' /absolute/path/to/file' }, {' path' : BytesIO(b ' I am content of file 2' )}]
329350 ... )
330351 >> > product
0 commit comments