entity.py
changeset 7552 82dde8276a5b
parent 7543 570522300e22
child 7702 73cadb5d0097
child 7899 4f6ff757f83c
equal deleted inserted replaced
7548:92fd4b777016 7552:82dde8276a5b
   431         # the object for use in the relation is tricky
   431         # the object for use in the relation is tricky
   432         # XXX search_state is web specific
   432         # XXX search_state is web specific
   433         use_ext_id = False
   433         use_ext_id = False
   434         if 'base_url' not in kwargs and \
   434         if 'base_url' not in kwargs and \
   435                getattr(self._cw, 'search_state', ('normal',))[0] == 'normal':
   435                getattr(self._cw, 'search_state', ('normal',))[0] == 'normal':
   436             baseurl = self.cw_metainformation()['source'].get('base-url')
   436             sourcemeta = self.cw_metainformation()['source']
   437             if baseurl:
   437             if sourcemeta.get('use-cwuri-as-url'):
   438                 kwargs['base_url'] = baseurl
   438                 return self.cwuri # XXX consider kwargs?
       
   439             if sourcemeta.get('base-url'):
       
   440                 kwargs['base_url'] = sourcemeta['base-url']
   439                 use_ext_id = True
   441                 use_ext_id = True
   440         if method in (None, 'view'):
   442         if method in (None, 'view'):
   441             try:
   443             try:
   442                 kwargs['_restpath'] = self.rest_path(use_ext_id)
   444                 kwargs['_restpath'] = self.rest_path(use_ext_id)
   443             except TypeError:
   445             except TypeError: