예제 #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