2011-03-04 20:56:16 |
Martin Pool |
description |
Other then documented in the reference (http://people.ubuntu.com/~flacoste/launchpad-api-doc.html#bug) bug.tags is not a whitespace separated string but a list. It would be nice if launchpadlib could support the related list operations properly, for example:
In [38]: b = launchpad.bugs[253799]
In [39]: b.tags
Out[39]: [u'bar', u'foo']
In [40]: b.tags.append("far")
n [41]: b._dirty_attributes
Out[41]: {}
This only works for changing the complete object:
In [42]: b.tags = ["bood"]
In [43]: b._dirty_attributes
Out[43]: {'tags': ['bood']}
Markus |
Other then documented in the reference (http://people.ubuntu.com/~flacoste/launchpad-api-doc.html#bug) bug.tags is not a whitespace separated string but a list. It would be nice if launchpadlib could support the related list operations properly, for example:
In [38]: b = launchpad.bugs[253799]
In [39]: b.tags
Out[39]: [u'bar', u'foo']
In [40]: b.tags.append("far")
n [41]: b._dirty_attributes
Out[41]: {}
This only works for changing the complete object:
In [42]: b.tags = ["bood"]
In [43]: b._dirty_attributes
Out[43]: {'tags': ['bood']}
Markus
---
Workaround: rather than appending to the list, set the attribute to a new list that has the value you want:
Not: b.tags.append('foo')
but rather: b.tags = b.tags + ['foo'] |
|