最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Getting images from same page as the content (link between attachments and the page it is from) XWiki REST API - Stack Overflow

programmeradmin4浏览0评论

Right now I am getting content from base/spaces/abc/pages/xyz which has data['id'] from response of 'base:abc.xyz' and the image from base/spaces/abc/pages/xyz/attachments where i do

        for each in data['attachments']:
             category = each['id']

which has category of 'base:[email protected]'... how do I link these together right now so that when i get a page I can find the images in that page

right now I am doing

match = re.match(r'(.*?)(?<!\\)@', category)
      if match:
          category = match.group(1) # to get category of 'base:abc.xyz

so that the image has the same id as the id of the page it is in and then find both.

BUT i am worried this is hardcoded, is it always the case that @ WITHOUT @ separates the filetype and the parent id of the page OR is this not standard and it was just the way this specific xwiki was configured?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论