예제 #1
0
 def save(self, db: DBManager):
     if self._id:
         order = db.get_order(self._id)
         order.is_current = self.is_current
         order.product_id = self.product_id
         order.quantity = self.quantity
         db.save_element(order)
     else:
         db.save_element(self.get_order())
예제 #2
0
 def delete(self, db: DBManager):
     if self._id:
         order = db.get_order(self._id)
         db.delete_element(order)