Browse Source

Правильная работа события удаление с родителем #11

order_cat
parent
commit
1ef958de16
  1. 11
      bot_modules/mod_table_operate.py

11
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))

Loading…
Cancel
Save