comparison libervia/backend/tools/common/data_objects.py @ 4099:11e802089b19

tools (common/data_objects): add `attachments` in Message
author Goffi <goffi@goffi.org>
date Thu, 22 Jun 2023 15:47:17 +0200
parents f8284f994948
children b274f0d5c138
comparison
equal deleted inserted replaced
4098:4a8b29ab34c0 4099:11e802089b19
102 try: 102 try:
103 return safe(self._html[""]) 103 return safe(self._html[""])
104 except KeyError: 104 except KeyError:
105 return safe(next(iter(self._html.values()))) 105 return safe(next(iter(self._html.values())))
106 106
107 @property
108 def attachments(self):
109 return self._extra.get("attachments", [])
110
111
107 112
108 class Messages(object): 113 class Messages(object):
109 def __init__(self, msgs_data): 114 def __init__(self, msgs_data):
110 self.messages = [Message(m) for m in msgs_data] 115 self.messages = [Message(m) for m in msgs_data]
111 116