Example #1
0
    def reserve_resource(self, rid, status, form):
        dao = ResourceDetailsDAO()
        result = dao.updateAvailability(rid, status)

        transactionHandler = TransactionHandler()
        transactionHandler.insertTransaction(form, rid)

        return jsonify(Reserved=result)
Example #2
0
    def purchase_resource(self, rid, status, form):
        dao = ResourceDetailsDAO()

        # Adding compatibility with transaction
        transactionHandler = TransactionHandler()
        transactionHandler.insertTransaction(form, rid)

        result = dao.updateAvailability(rid, status)
        return jsonify(Reserved=result)