Updates the given field to the given value as long as the value is not None and the new value is different from the current value. Ignoring None prevents current property values from being overwritten to None if the given property is not intentionally passed back to be updat
(self, field, value)
| 27 | return self |
| 28 | |
| 29 | def update(self, field, value): |
| 30 | """ |
| 31 | Updates the given field to the given value as long as the value is not None and the new value is different from |
| 32 | the current value. Ignoring None prevents current property values from being overwritten to None if the given |
| 33 | property is not intentionally passed back to be updated (example: Agent heartbeat) |
| 34 | |
| 35 | :param field: object property to update |
| 36 | :param value: value to update to |
| 37 | """ |
| 38 | if (value is not None) and (value != self.__getattribute__(field)): |
| 39 | self.__setattr__(field, value) |
| 40 | |
| 41 | def search_tags(self, value): |
| 42 | tags = getattr(self, 'tags', None) |
no outgoing calls