NP-2 Кнопки на страницах item

This commit is contained in:
Mikan
2024-10-02 21:43:27 +03:00
parent 0d516765df
commit e95d4b6c1c

View File

@@ -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