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

Right now I am getting content from basespacesabcpagesxyz which has data['id'] from respo

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745560982a4633107.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信