@@ -61,6 +61,14 @@ create
6161 - 1 - public
6262 - 2 - private
6363
64+ :param dict avatar:
65+ .. raw :: html
66+
67+ (optional). Avatar to be used for the contact as dict, accepted keys are:
68+
69+ - path (required). Absolute file path or file-like object that should be uploaded.
70+ - filename (optional). Required if a file-like object is provided.
71+
6472 :return: :ref: `Resource ` object
6573
6674.. code-block :: python
8290 ... is_company = False ,
8391 ... address_attributes = {' street1' : ' foo' , ' street2' : ' bar' , ' city' : ' Moscow' , ' postcode' : ' 111111' , ' country_code' : ' RU' },
8492 ... custom_fields = [{' id' : 1 , ' value' : ' foo' }, {' id' : 2 , ' value' : ' bar' }],
85- ... visibility = 0
93+ ... visibility = 0 ,
94+ ... avatar = {' path' : ' /absolute/path/to/file.jpg' }
8695 ... )
8796 >> > contact
8897 < redminelib.resources.Contact # 1 "Ivan Ivanov">
120129 >> > contact.address_attributes = {' street1' : ' foo' , ' street2' : ' bar' , ' city' : ' Moscow' , ' postcode' : ' 111111' , ' country_code' : ' RU' }
121130 >> > contact.custom_fields = [{' id' : 1 , ' value' : ' foo' }, {' id' : 2 , ' value' : ' bar' }]
122131 >> > contact.visibility = 0
132+ >> > contact.avatar = {' path' : ' /absolute/path/to/file.jpg' }
123133 >> > contact.save()
124134 < redminelib.resources.Contact # 1 "Ivan Ivanov">
125135
@@ -311,6 +321,14 @@ update
311321 - 1 - public
312322 - 2 - private
313323
324+ :param dict avatar:
325+ .. raw :: html
326+
327+ (optional). Avatar to be used for the contact as dict, accepted keys are:
328+
329+ - path (required). Absolute file path or file-like object that should be uploaded.
330+ - filename (optional). Required if a file-like object is provided.
331+
314332 :return: True
315333
316334.. code-block :: python
@@ -332,7 +350,8 @@ update
332350 ... is_company = False ,
333351 ... address_attributes = {' street1' : ' foo' , ' street2' : ' bar' , ' city' : ' Moscow' , ' postcode' : ' 111111' , ' country_code' : ' RU' },
334352 ... custom_fields = [{' id' : 1 , ' value' : ' foo' }, {' id' : 2 , ' value' : ' bar' }],
335- ... visibility = 0
353+ ... visibility = 0 ,
354+ ... avatar = {' path' : ' /absolute/path/to/file.jpg' }
336355 ... )
337356 True
338357
367386 >> > contact.address_attributes = {' street1' : ' foo' , ' street2' : ' bar' , ' city' : ' Moscow' , ' postcode' : ' 111111' , ' country_code' : ' RU' }
368387 >> > contact.custom_fields = [{' id' : 1 , ' value' : ' foo' }, {' id' : 2 , ' value' : ' bar' }]
369388 >> > contact.visibility = 0
389+ >> > contact.avatar = {' path' : ' /absolute/path/to/file.jpg' }
370390 >> > contact.save()
371391 < redminelib.resources.Contact # 12345 "Ivan Ivanov">
372392
390410 ... is_company = False ,
391411 ... address_attributes = {' street1' : ' foo' , ' street2' : ' bar' , ' city' : ' Moscow' , ' postcode' : ' 111111' , ' country_code' : ' RU' },
392412 ... custom_fields = [{' id' : 1 , ' value' : ' foo' }, {' id' : 2 , ' value' : ' bar' }],
393- ... visibility = 0
413+ ... visibility = 0 ,
414+ ... avatar = {' path' : ' /absolute/path/to/file.jpg' }
394415 ... )
395416 >> > contact
396417 < redminelib.resources.Contact # 12345 "Ivan Ivanov">
0 commit comments