diff --git a/common/models.py b/common/models.py index 2df16ae..e3f6b04 100644 --- a/common/models.py +++ b/common/models.py @@ -82,11 +82,15 @@ class ItemData(models.Model): @property def item_dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: + + context_buttons = [{"name": cb.button_type.verbose, "url": cb.url} for cb in self.context_buttons.all()] + return { "image": self.image.url, "title": self.title, "shortDescription": self.short_description, "description": self.description, + "contextButtons": context_buttons } @property