コード例 #1
0
ファイル: model.py プロジェクト: NatName/BD_2
 def delete_shop(self, shopId):
     try:
         assert not Additional.findExistingIdOrderTable(self.connection, self.tableName, shopId), \
             '\033[91m shop id bind with order \033[0m'
         assert Additional.findExistingId(self.connection, self.tableName, shopId), \
             '\033[91m id isn\'t exist \033[0m'
         baseData.delete_one(self.connection, shopId, self.tableName)
         return True
     except Exception as err:
         print(err)
         return False
コード例 #2
0
ファイル: model.py プロジェクト: NatName/BD_2
 def delete_customer(self, customerId):
     try:
         assert not Additional.findExistingIdOrderTable(self.connection, self.tableName, customerId),\
             '\033[91m You don\'t delete customer, because this customer bind with order \033[0m'
         assert Additional.findExistingId(self.connection, self.tableName, customerId), \
             '\033[91m id isn\'t exist \033[0m'
         baseData.delete_one(self.connection, customerId, self.tableName)
         return True
     except Exception as err:
         print(err)
         return False