コード例 #1
0
    def delete(self, id):

        stock = Stock.query.filter(Stock.id_ == id).first()

        if not stock:
            return response('Not Found', f'Item with Item Code {id} is not available.', 404)

        db_session.delete(stock)
        db_session.commit()

        return response('Delete Successful.', f'Successfully deleted the Items with Item Code {str(id)}', 200, stock_schema.dump(stock))
コード例 #2
0
    def delete(self, id):
        bill = Bills.query.filter(Bills.id_ == id).first()

        if not bill:
            return response('Not Found',
                            f'Bill with Bill Code {id} is not available.', 404)

        db_session.delete(bill)
        db_session.commit()

        return response(
            'Deleted Successfully.',
            f'Successfully deleted the Bill with Code {str(bill.bill_number)}',
            200, bill_schema.dump(bill))
コード例 #3
0
ファイル: views.py プロジェクト: saneshdealwis/backend
    def delete(self, id):
        if not request.content_type == 'application/json':
            return response('failed', 'Content-type must be application/json',
                            401)

        payment = Payments.query.filter(Payments.id_ == id).first()

        if not payment:
            abort(404)

        db_session.delete(payment)
        db_session.commit()

        return response(
            'success',
            'Successfully deleted the item from Payments with Id ' + str(id),
            200)
コード例 #4
0
ファイル: views.py プロジェクト: saneshdealwis/backend
    def delete(self, id):
        if not request.content_type == 'application/json':
            return response('failed', 'Content-type must be application/json',
                            401)

        distributor = Distributors.query.filter(Distributors.id_ == id).first()

        if not distributor:
            abort(404)

        db_session.delete(distributor)
        db_session.commit()

        return response(
            'success',
            'Successfully deleted the item from Distributors with Id ' +
            str(id), 200)
コード例 #5
0
    def delete(self, id):
        """function for "DELETE /clients/<id>" endpoint

        Args:
            id (int): id for the Client

        Returns:
            {
                "status" : "success,
                "message" : "Successfully deleted the item from Clients with Id 1"
            }
        """

        client = Clients.query.filter(Clients.id_ == id).first()

        if not client:
            abort(404)

        db_session.delete(client)
        db_session.commit()

        return response('success', 'Successfully deleted the item from Client with Id ' + str(id), 200)
コード例 #6
0
 def delete_by_uuid(self, uuid):
     task = self.get_by_uuid(uuid)
     db_session.delete(task)
     db_session.commit()
コード例 #7
0
 def delete_by_uuid(self, uuid):
     project = self.get_by_uuid(uuid)
     db_session.delete(project)
     db_session.commit()
コード例 #8
0
 def delete_by_uuid(self, uuid):
     container = self.get_by_uuid(uuid)
     db_session.delete(container)
     db_session.commit()
コード例 #9
0
 def delete_by_uuid(self, uuid):
     pod = self.get_by_uuid(uuid)
     db_session.delete(pod)
     db_session.commit()
コード例 #10
0
 def delete_by_uuid(self, uuid):
     image = self.get_by_uuid(uuid)
     db_session.delete(image)
     db_session.commit()
コード例 #11
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     environment = self.get_by_uuid(uuid)
     db_session.delete(environment)
     db_session.commit()
コード例 #12
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     task = self.get_by_uuid(uuid)
     db_session.delete(task)
     db_session.commit()
コード例 #13
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     project = self.get_by_uuid(uuid)
     db_session.delete(project)
     db_session.commit()
コード例 #14
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     container = self.get_by_uuid(uuid)
     db_session.delete(container)
     db_session.commit()
コード例 #15
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     pod = self.get_by_uuid(uuid)
     db_session.delete(pod)
     db_session.commit()
コード例 #16
0
 def delete_by_uuid(self, uuid):
     environment = self.get_by_uuid(uuid)
     db_session.delete(environment)
     db_session.commit()
コード例 #17
0
 def delete_by_uuid(self, uuid):
     openrc = self.get_by_uuid(uuid)
     db_session.delete(openrc)
     db_session.commit()
コード例 #18
0
ファイル: handlers.py プロジェクト: mythwm/yardstick-ha
 def delete_by_uuid(self, uuid):
     openrc = self.get_by_uuid(uuid)
     db_session.delete(openrc)
     db_session.commit()