From 1ef958de161d3b66c487d58087490cd9bb94ee2b Mon Sep 17 00:00:00 2001 From: Alexei Bezborodov Date: Tue, 14 Nov 2023 08:58:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=20=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D1=82=D0=B5=D0=BB=D0=B5=D0=BC=20#11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot_modules/mod_table_operate.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bot_modules/mod_table_operate.py b/bot_modules/mod_table_operate.py index 1753bf4..4188812 100644 --- a/bot_modules/mod_table_operate.py +++ b/bot_modules/mod_table_operate.py @@ -259,11 +259,16 @@ class TableOperateModule(mod_simple_message.SimpleMessageModule): item_id = a_ItemID await self.SendSubscribe(subscribe_type, item_id, user_id) - parent_id_field = self.m_Table.GetFieldNameByDestiny(bd_table.TableFieldDestiny.PARENT_ID) + table_name = self.m_Table.GetName() + key_name = self.GetKeyFieldName() - if parent_id_field and a_ItemData[parent_id_field]: + cur_item = GetCurItem(self.m_Bot, table_name, key_name, a_ItemID) + print(cur_item) + + parent_id_field_index = self.m_Table.GetFieldIDByDestiny(bd_table.TableFieldDestiny.PARENT_ID) + if parent_id_field_index and cur_item and cur_item[parent_id_field_index]: subscribe_type = bot_subscribes.SubscribeType.ANY_ITEM_DEL_WITH_PARENT - item_id = a_ItemData[parent_id_field] + item_id = cur_item[parent_id_field_index] await self.SendSubscribe(subscribe_type, item_id, user_id) return simple_message.WorkFuncResult(self.GetMessage(Messages.SUCCESS_DELETE))