예제 #1
0
    def get(self, id):
        session_id = get_session_id(session, request)

        dao = AssetDAO(session_id)
        asset = dao.get_asset_by_id(id)
        dao.close()
        if asset is None:
            raise ObjectNotFoundHTTPError('The asset')

        resp = make_response(json_serialize(asset, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp
예제 #2
0
    def get(self, id):
        session_id = get_session_id(session, request)

        dao = AssetDAO(session_id)
        asset = dao.get_asset_by_id(id)
        dao.close()
        if asset is None:
            raise ObjectNotFoundHTTPError('The asset')

        resp = make_response(json_serialize(asset, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp