cubicweb/web/request.py
changeset 11799 1bdfe9d4ab83
parent 11794 d8830e2bd2e0
child 11825 52acf0dbf4cd
equal deleted inserted replaced
11798:55f678f128ef 11799:1bdfe9d4ab83
   659                 and not '_restpath' in kwargs):
   659                 and not '_restpath' in kwargs):
   660                 method = self.relative_path(includeparams=False) or 'view'
   660                 method = self.relative_path(includeparams=False) or 'view'
   661             args = (method,)
   661             args = (method,)
   662         return super(_CubicWebRequestBase, self).build_url(*args, **kwargs)
   662         return super(_CubicWebRequestBase, self).build_url(*args, **kwargs)
   663 
   663 
       
   664     def build_url_path(self, *args):
       
   665         path = super(_CubicWebRequestBase, self).build_url_path(*args)
       
   666         lang_prefix = ''
       
   667         if self.lang and self.vreg.config.get('language-mode') == 'url-prefix':
       
   668             lang_prefix = '%s/' % self.lang
       
   669         return lang_prefix + path
       
   670 
   664     def url(self, includeparams=True):
   671     def url(self, includeparams=True):
   665         """return currently accessed url"""
   672         """return currently accessed url"""
   666         return self.base_url() + self.relative_path(includeparams)
   673         return self.base_url() + self.relative_path(includeparams)
   667 
   674 
   668     def selected(self, url):
   675     def selected(self, url):
   930                 self.set_language(lang)
   937                 self.set_language(lang)
   931                 return
   938                 return
   932             except KeyError:
   939             except KeyError:
   933                 pass
   940                 pass
   934         # site's default language
   941         # site's default language
   935         if self.lang is None:
   942         self.set_default_language(vreg)
   936             self.set_default_language(vreg)
       
   937 
   943 
   938 
   944 
   939 def _cnx_func(name):
   945 def _cnx_func(name):
   940     def proxy(req, *args, **kwargs):
   946     def proxy(req, *args, **kwargs):
   941         return getattr(req.cnx, name)(*args, **kwargs)
   947         return getattr(req.cnx, name)(*args, **kwargs)