Esempio n. 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))
Esempio n. 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))
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 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)
Esempio n. 6
0
 def delete_by_uuid(self, uuid):
     task = self.get_by_uuid(uuid)
     db_session.delete(task)
     db_session.commit()
Esempio n. 7
0
 def delete_by_uuid(self, uuid):
     project = self.get_by_uuid(uuid)
     db_session.delete(project)
     db_session.commit()
Esempio n. 8
0
 def delete_by_uuid(self, uuid):
     container = self.get_by_uuid(uuid)
     db_session.delete(container)
     db_session.commit()
Esempio n. 9
0
 def delete_by_uuid(self, uuid):
     pod = self.get_by_uuid(uuid)
     db_session.delete(pod)
     db_session.commit()
Esempio n. 10
0
 def delete_by_uuid(self, uuid):
     image = self.get_by_uuid(uuid)
     db_session.delete(image)
     db_session.commit()
Esempio n. 11
0
 def delete_by_uuid(self, uuid):
     environment = self.get_by_uuid(uuid)
     db_session.delete(environment)
     db_session.commit()
Esempio n. 12
0
 def delete_by_uuid(self, uuid):
     task = self.get_by_uuid(uuid)
     db_session.delete(task)
     db_session.commit()
Esempio n. 13
0
 def delete_by_uuid(self, uuid):
     project = self.get_by_uuid(uuid)
     db_session.delete(project)
     db_session.commit()
Esempio n. 14
0
 def delete_by_uuid(self, uuid):
     container = self.get_by_uuid(uuid)
     db_session.delete(container)
     db_session.commit()
Esempio n. 15
0
 def delete_by_uuid(self, uuid):
     pod = self.get_by_uuid(uuid)
     db_session.delete(pod)
     db_session.commit()
Esempio n. 16
0
 def delete_by_uuid(self, uuid):
     environment = self.get_by_uuid(uuid)
     db_session.delete(environment)
     db_session.commit()
Esempio n. 17
0
 def delete_by_uuid(self, uuid):
     openrc = self.get_by_uuid(uuid)
     db_session.delete(openrc)
     db_session.commit()
Esempio n. 18
0
 def delete_by_uuid(self, uuid):
     openrc = self.get_by_uuid(uuid)
     db_session.delete(openrc)
     db_session.commit()