From e95d4b6c1ca07ac42073d30fb323fb2366d03f61 Mon Sep 17 00:00:00 2001 From: Mikan <72257910+Mikan-DS@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:43:27 +0300 Subject: [PATCH] =?UTF-8?q?NP-2=20=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=D1=85=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/models.py | 4 ++++ 1 file changed, 4 insertions(+) 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