[api] some more _cw / __regid__, automatic tests now pass again
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 24 Sep 2009 00:24:21 +0200
changeset 3460 e4843535db25
parent 3459 e134d2dd9992
child 3461 8a11aeea4d25
[api] some more _cw / __regid__, automatic tests now pass again
common/mixins.py
entities/lib.py
web/action.py
web/controller.py
web/httpcache.py
web/test/unittest_breadcrumbs.py
web/test/unittest_controller.py
web/views/authentication.py
web/views/basecontrollers.py
web/views/basetemplates.py
web/views/calendar.py
web/views/cwproperties.py
web/views/cwuser.py
web/views/editforms.py
web/views/editviews.py
web/views/embedding.py
web/views/facets.py
web/views/ibreadcrumbs.py
web/views/idownloadable.py
web/views/igeocodable.py
web/views/iprogress.py
web/views/owl.py
web/views/sparql.py
web/views/startup.py
web/views/tabs.py
web/views/timeline.py
web/views/timetable.py
web/views/treeview.py
web/views/vcard.py
web/views/wdoc.py
web/views/workflow.py
web/views/xmlrss.py
--- a/common/mixins.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/common/mixins.py	Thu Sep 24 00:24:21 2009 +0200
@@ -207,7 +207,7 @@
     """handle an infinite recursion safety belt"""
     if done is None:
         done = set()
-    entity = view.rset.get_entity(row, col)
+    entity = view.cw_rset.get_entity(row, col)
     if entity.eid in done:
         msg = entity._cw._('loop in %(rel)s relation (%(eid)s)') % {
             'rel': entity.tree_attribute,
--- a/entities/lib.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/entities/lib.py	Thu Sep 24 00:24:21 2009 +0200
@@ -109,11 +109,11 @@
     rest_attr = 'pkey'
 
     def typed_value(self):
-        return self.vreg.typed_value(self.pkey, self.value)
+        return self._cw.vreg.typed_value(self.pkey, self.value)
 
     def dc_description(self, format='text/plain'):
         try:
-            return self._cw._(self.vreg.property_info(self.pkey)['help'])
+            return self._cw._(self._cw.vreg.property_info(self.pkey)['help'])
         except UnknownProperty:
             return u''
 
--- a/web/action.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/action.py	Thu Sep 24 00:24:21 2009 +0200
@@ -91,7 +91,7 @@
     def url(self):
         current_entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
         linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self))
-        return self.build_url('add/%s' % self.etype, __linkto=linkto,
-                              __redirectpath=current_entity.rest_path(), # should not be url quoted!
-                              __redirectvid=self._cw.form.get('__redirectvid', ''))
+        return self._cw.build_url('add/%s' % self.etype, __linkto=linkto,
+                                  __redirectpath=current_entity.rest_path(), # should not be url quoted!
+                                  __redirectvid=self._cw.form.get('__redirectvid', ''))
 
--- a/web/controller.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/controller.py	Thu Sep 24 00:24:21 2009 +0200
@@ -198,7 +198,7 @@
             path = self._edited_entity.rest_path()
         else:
             path = 'view'
-        url = self.build_url(path, **newparams)
+        url = self._cw.build_url(path, **newparams)
         url = append_url_params(url, self.req.form.get('__redirectparams'))
         raise Redirect(url)
 
@@ -223,7 +223,7 @@
         for redirectparam in NAV_FORM_PARAMETERS:
             if redirectparam in form:
                 newparams[redirectparam] = form[redirectparam]
-        raise Redirect(self.build_url(path, **newparams))
+        raise Redirect(self._cw.build_url(path, **newparams))
 
 
     def _return_to_lastpage(self, newparams):
@@ -235,7 +235,7 @@
         if '__redirectpath' in self.req.form:
             # if redirect path was explicitly specified in the form, use it
             path = self.req.form['__redirectpath']
-            url = self.build_url(path, **newparams)
+            url = self._cw.build_url(path, **newparams)
             url = append_url_params(url, self.req.form.get('__redirectparams'))
         else:
             url = self.req.last_visited_page()
--- a/web/httpcache.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/httpcache.py	Thu Sep 24 00:24:21 2009 +0200
@@ -17,7 +17,7 @@
     """default cache manager: set no-cache cache control policy"""
     def __init__(self, view):
         self.view = view
-        self.req = view.req
+        self.req = view._cw
         self.cw_rset = view.rset
 
     def set_headers(self):
@@ -42,7 +42,7 @@
     date_format = "%a, %d %b %Y %H:%M:%S GMT"
 
     def etag(self):
-        return self.view.id + '/' + ','.join(sorted(self.req.user.groups))
+        return self.view.__regid__ + '/' + ','.join(sorted(self.req.user.groups))
 
     def max_age(self):
         # 0 to actually force revalidation
--- a/web/test/unittest_breadcrumbs.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/test/unittest_breadcrumbs.py	Thu Sep 24 00:24:21 2009 +0200
@@ -1,6 +1,6 @@
-from cubicweb.devtools.testlib import WebTest
+from cubicweb.devtools.testlib import CubicWebTC
 
-class BreadCrumbsTC(WebTest):
+class BreadCrumbsTC(CubicWebTC):
 
     def test_base(self):
         f1 = self.add_entity('Folder', name=u'par&ent')
--- a/web/test/unittest_controller.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/test/unittest_controller.py	Thu Sep 24 00:24:21 2009 +0200
@@ -13,7 +13,7 @@
 
     def test_parse_datetime_ok(self):
         ctrl = self.vreg['controllers'].select('view', self.request())
-        pd = ctrl.parse_datetime
+        pd = ctrl._cw.parse_datetime
         self.assertIsInstance(pd('2006/06/24 12:18'), datetime)
         self.assertIsInstance(pd('2006/06/24'), date)
         self.assertIsInstance(pd('2006/06/24 12:18', 'Datetime'), datetime)
@@ -23,7 +23,7 @@
 
     def test_parse_datetime_ko(self):
         ctrl = self.vreg['controllers'].select('view', self.request())
-        pd = ctrl.parse_datetime
+        pd = ctrl._cw.parse_datetime
         self.assertRaises(ValueError,
                           pd, '2006/06/24 12:188', 'Datetime')
         self.assertRaises(ValueError,
--- a/web/views/authentication.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/authentication.py	Thu Sep 24 00:24:21 2009 +0200
@@ -73,19 +73,19 @@
             login, password = req.get_authorization()
         if not login:
             # No session and no login -> try anonymous
-            login, password = self._cw.vreg.config.anonymous_user()
+            login, password = self.vreg.config.anonymous_user()
             if not login: # anonymous not authorized
                 raise ExplicitLogin()
         # remove possibly cached cursor coming from closed connection
         clear_cache(req, 'cursor')
-        cnxprops = ConnectionProperties(self._cw.vreg.config.repo_method,
+        cnxprops = ConnectionProperties(self.vreg.config.repo_method,
                                         close=False, log=self.log_queries)
         try:
             cnx = repo_connect(self.repo, login, password, cnxprops=cnxprops)
         except AuthenticationError:
             req.set_message(req._('authentication failure'))
             # restore an anonymous connection if possible
-            anonlogin, anonpassword = self._cw.vreg.config.anonymous_user()
+            anonlogin, anonpassword = self.vreg.config.anonymous_user()
             if anonlogin and anonlogin != login:
                 cnx = repo_connect(self.repo, anonlogin, anonpassword,
                                    cnxprops=cnxprops)
@@ -100,9 +100,9 @@
 
     def _init_cnx(self, cnx, login, password):
         # decorate connection
-        if login == self._cw.vreg.config.anonymous_user()[0]:
+        if login == self.vreg.config.anonymous_user()[0]:
             cnx.anonymous_connection = True
-        cnx.vreg = self._cw.vreg
+        cnx.vreg = self.vreg
         cnx.login = login
         cnx.password = password
 
--- a/web/views/basecontrollers.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/basecontrollers.py	Thu Sep 24 00:24:21 2009 +0200
@@ -422,7 +422,7 @@
     def js_format_date(self, strdate):
         """returns the formatted date for `msgid`"""
         date = strptime(strdate, '%Y-%m-%d %H:%M:%S')
-        return self.format_date(date)
+        return self._cw.format_date(date)
 
     @jsonize
     def js_external_resource(self, resource):
@@ -563,7 +563,7 @@
         except Exception, ex:
             self.exception("can't connect to smtp server %s:%s (%s)",
                              mailhost, port, ex)
-            url = self.build_url(__message=self._cw._('could not connect to the SMTP server'))
+            url = self._cw.build_url(__message=self._cw._('could not connect to the SMTP server'))
             raise Redirect(url)
 
     def sendmail(self, recipient, subject, body):
@@ -583,7 +583,7 @@
             text = body % recipient.as_email_context()
             self.sendmail(recipient.get_email(), subject, text)
         # breadcrumbs = self._cw.get_session_data('breadcrumbs', None)
-        url = self.build_url(__message=self._cw._('emails successfully sent'))
+        url = self._cw.build_url(__message=self._cw._('emails successfully sent'))
         raise Redirect(url)
 
 
@@ -594,6 +594,6 @@
     def publish(self, rset=None):
         body = self._cw.form['description']
         self.sendmail(self._cw.config['submit-mail'], _('%s error report') % self._cw.config.appid, body)
-        url = self.build_url(__message=self._cw._('bug report sent'))
+        url = self._cw.build_url(__message=self._cw._('bug report sent'))
         raise Redirect(url)
 
--- a/web/views/basetemplates.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/basetemplates.py	Thu Sep 24 00:24:21 2009 +0200
@@ -59,7 +59,7 @@
         msg = self._cw._('you have been logged out')
         w(u'<h2>%s</h2>\n' % msg)
         if self._cw.config['anonymous-user']:
-            indexurl = self.build_url('view', vid='index', __message=msg)
+            indexurl = self._cw.build_url('view', vid='index', __message=msg)
             w(u'<p><a href="%s">%s</a><p>' % (
                 xml_escape(indexurl),
                 self._cw._('go back to the index page')))
--- a/web/views/calendar.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/calendar.py	Thu Sep 24 00:24:21 2009 +0200
@@ -285,13 +285,13 @@
 
         if len(self.cw_rset.column_types(0)) == 1:
             etype = list(self.cw_rset.column_types(0))[0]
-            url = self.build_url(vid='creation', etype=etype,
-                                 schedule=True,
-                                 start=self._cw.format_date(celldate), stop=self._cw.format_date(celldate),
-                                 __redirectrql=self.cw_rset.printable_rql(),
-                                 __redirectparams=self._cw.build_url_params(year=curdate.year, month=curmonth),
-                                 __redirectvid=self.__regid__
-                                 )
+            url = self._cw.build_url(vid='creation', etype=etype,
+                                     schedule=True,
+                                     start=self._cw.format_date(celldate), stop=self._cw.format_date(celldate),
+                                     __redirectrql=self.cw_rset.printable_rql(),
+                                     __redirectparams=self._cw.build_url_params(year=curdate.year, month=curmonth),
+                                     __redirectvid=self.__regid__
+                                     )
             self.w(u'<div class="cmd"><a href="%s">%s</a></div>' % (xml_escape(url), self._cw._(u'add')))
             self.w(u'&#160;')
         self.w(u'</div>')
@@ -422,12 +422,12 @@
             self.w(u'<td class="column %s" id="%s">' % (classes, day))
             if len(self.cw_rset.column_types(0)) == 1:
                 etype = list(self.cw_rset.column_types(0))[0]
-                url = self.build_url(vid='creation', etype=etype,
-                                     schedule=True,
-                                     __redirectrql=self.cw_rset.printable_rql(),
-                                     __redirectparams=self._cw.build_url_params(year=year, week=week),
-                                     __redirectvid=self.__regid__
-                                     )
+                url = self._cw.build_url(vid='creation', etype=etype,
+                                         schedule=True,
+                                         __redirectrql=self.cw_rset.printable_rql(),
+                                         __redirectparams=self._cw.build_url_params(year=year, week=week),
+                                         __redirectvid=self.__regid__
+                                         )
                 extra = ' ondblclick="addCalendarItem(event, hmin=8, hmax=20, year=%s, month=%s, day=%s, duration=2, baseurl=\'%s\')"' % (
                     wdate.year, wdate.month, wdate.day, xml_escape(url))
             else:
--- a/web/views/cwproperties.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/cwproperties.py	Thu Sep 24 00:24:21 2009 +0200
@@ -211,10 +211,10 @@
         else:
             label = key
         subform = self._cw.vreg['forms'].select('base', self._cw, entity=entity,
-                                            mainform=False)
+                                                mainform=False)
         subform.append_field(PropertyValueField(name='value', label=label,
                                                 eidparam=True))
-        subform.vreg = self._cw.vreg
+        #subform.vreg = self._cw.vreg
         subform.form_add_hidden('pkey', key, eidparam=True)
         form.form_add_subform(subform)
         return subform
@@ -265,7 +265,7 @@
         # empty span as well else html validation fail (label is refering to
         # this id)
         return '<div id="div:%s"><span id="%s">%s</span></div>' % (
-            domid, domid, form.req._('select a key first'))
+            domid, domid, form._cw._('select a key first'))
 
 
 class NotEditableWidget(object):
@@ -289,17 +289,17 @@
 
     def render(self, form, renderer):
         wdg = self.get_widget(form)
-        wdg.attrs['tabindex'] = form.req.next_tabindex()
+        wdg.attrs['tabindex'] = form._cw.next_tabindex()
         wdg.attrs['onchange'] = "javascript:setPropValueWidget('%s', %s)" % (
-            form.edited_entity.eid, form.req.next_tabindex())
+            form.edited_entity.eid, form._cw.next_tabindex())
         return wdg.render(form, self, renderer)
 
     def vocabulary(self, form):
         entity = form.edited_entity
-        _ = form.req._
+        _ = form._cw._
         if entity.has_eid():
             return [(_(entity.pkey), entity.pkey)]
-        choices = entity.vreg.user_property_keys()
+        choices = entity._cw.vreg.user_property_keys()
         return [(u'', u'')] + sorted(zip((_(v) for v in choices), choices))
 
 
@@ -322,15 +322,15 @@
             # on key selection
             return
         try:
-            pdef = form.vreg.property_info(entity.pkey)
+            pdef = form._cw.vreg.property_info(entity.pkey)
         except UnknownProperty, ex:
             self.warning('%s (you should probably delete that property '
                          'from the database)', ex)
-            msg = form.req._('you should probably delete that property')
+            msg = form._cw._('you should probably delete that property')
             self.widget = NotEditableWidget(entity.printable_value('value'),
                                             '%s (%s)' % (msg, ex))
         if entity.pkey.startswith('system.'):
-            msg = form.req._('value associated to this key is not editable '
+            msg = form._cw._('value associated to this key is not editable '
                              'manually')
             self.widget = NotEditableWidget(entity.printable_value('value'), msg)
         # XXX race condition when used from CWPropertyForm, should not rely on
@@ -341,7 +341,7 @@
         if vocab is not None:
             if callable(vocab):
                 # list() just in case its a generator function
-                self.choices = list(vocab(form.req))
+                self.choices = list(vocab(form._cw))
             else:
                 self.choices = vocab
             wdg = Select()
--- a/web/views/cwuser.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/cwuser.py	Thu Sep 24 00:24:21 2009 +0200
@@ -25,8 +25,8 @@
     category = 'mainactions'
 
     def url(self):
-        login = self.cw_rset.get_entity(self.cw_row or 0, self.col or 0).login
-        return self.build_url('cwuser/%s'%login, vid='propertiesform')
+        login = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0).login
+        return self._cw.build_url('cwuser/%s'%login, vid='propertiesform')
 
 
 class FoafView(EntityView):
--- a/web/views/editforms.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/editforms.py	Thu Sep 24 00:24:21 2009 +0200
@@ -297,8 +297,9 @@
     def render_form(self, entity):
         """fetch and render the form"""
         self.form_title(entity)
-        form = self._cw.vreg['forms'].select('edition', self._cw, rset=entity.rset,
-                                             row=entity.row, col=entity.col, entity=entity,
+        form = self._cw.vreg['forms'].select('edition', self._cw, rset=entity.cw_rset,
+                                             row=entity.cw_row, col=entity.cw_col,
+                                             entity=entity,
                                              submitmsg=self.submited_message())
         self.init_form(form, entity)
         self.w(form.form_render(formvid=u'edition'))
--- a/web/views/editviews.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/editviews.py	Thu Sep 24 00:24:21 2009 +0200
@@ -141,7 +141,7 @@
         _ = self._cw._
         for eschema in targettypes:
             mode = '%s:%s:%s:%s' % (target, entity.eid, rschema.type, eschema)
-            url = self.build_url(entity.rest_path(), vid='search-associate',
+            url = self._cw.build_url(entity.rest_path(), vid='search-associate',
                                  __mode=mode)
             options.append((eschema.display_name(self._cw),
                             '<option value="%s">%s %s</option>' % (
--- a/web/views/embedding.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/embedding.py	Thu Sep 24 00:24:21 2009 +0200
@@ -103,8 +103,8 @@
         entity = self.cw_rset.get_entity(row, 0)
         url = urljoin(self._cw.base_url(), entity.embeded_url())
         if self._cw.form.has_key('rql'):
-            return self.build_url('embed', url=url, rql=self._cw.form['rql'])
-        return self.build_url('embed', url=url)
+            return self._cw.build_url('embed', url=url, rql=self._cw.form['rql'])
+        return self._cw.build_url('embed', url=url)
 
 
 
--- a/web/views/facets.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/facets.py	Thu Sep 24 00:24:21 2009 +0200
@@ -109,8 +109,8 @@
             bk_path = 'view?rql=%s' % rset.printable_rql()
             bk_title = self._cw._('my custom search')
             linkto = 'bookmarked_by:%s:subject' % self._cw.user.eid
-            bk_add_url = self.build_url('add/Bookmark', path=bk_path, title=bk_title, __linkto=linkto)
-            bk_base_url = self.build_url('add/Bookmark', title=bk_title, __linkto=linkto)
+            bk_add_url = self._cw.build_url('add/Bookmark', path=bk_path, title=bk_title, __linkto=linkto)
+            bk_base_url = self._cw.build_url('add/Bookmark', title=bk_title, __linkto=linkto)
             bk_link = u'<a cubicweb:target="%s" id="facetBkLink" href="%s">%s</a>' % (
                     xml_escape(bk_base_url),
                     xml_escape(bk_add_url),
--- a/web/views/ibreadcrumbs.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/ibreadcrumbs.py	Thu Sep 24 00:24:21 2009 +0200
@@ -44,7 +44,7 @@
     def render_breadcrumbs(self, contextentity, path):
         root = path.pop(0)
         if isinstance(root, Entity):
-            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.id),
+            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.__regid__),
                                              root.dc_type('plural')))
             self.w(self.separator)
         self.wpath_part(root, contextentity, not path)
@@ -76,7 +76,7 @@
         # XXX hack: only display etype name or first non entity path part
         root = path.pop(0)
         if isinstance(root, Entity):
-            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.id),
+            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.__regid__),
                                              root.dc_type('plural')))
         else:
             self.wpath_part(root, contextentity, not path)
--- a/web/views/idownloadable.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/idownloadable.py	Thu Sep 24 00:24:21 2009 +0200
@@ -26,7 +26,7 @@
     return 1
 
 def download_box(w, entity, title=None, label=None):
-    req = entity.req
+    req = entity._cw
     w(u'<div class="sideBox">')
     if title is None:
         title = req._('download')
@@ -104,9 +104,9 @@
         self.w(u'<div class="content">')
         contenttype = entity.download_content_type()
         if contenttype.startswith('image/'):
-            self.wview('image', entity.rset, row=entity.row)
+            self.wview('image', entity.cw_rset, row=entity.cw_row)
         else:
-            self.wview('downloadlink', entity.rset, title=self._cw._('download'), row=entity.row)
+            self.wview('downloadlink', entity.cw_rset, title=self._cw._('download'), row=entity.cw_row)
             try:
                 if ENGINE.has_input(contenttype):
                     self.w(entity.printable_value('data'))
--- a/web/views/igeocodable.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/igeocodable.py	Thu Sep 24 00:24:21 2009 +0200
@@ -81,9 +81,9 @@
         self._cw.add_js( ('cubicweb.widgets.js', 'cubicweb.gmap.js', 'gmap.utility.labeledmarker.js') )
         rql = self.cw_rset.printable_rql()
         if urlparams is None:
-            loadurl = self.build_url(rql=rql, vid='geocoding-json')
+            loadurl = self._cw.build_url(rql=rql, vid='geocoding-json')
         else:
-            loadurl = self.build_url(rql=rql, vid='geocoding-json', **urlparams)
+            loadurl = self._cw.build_url(rql=rql, vid='geocoding-json', **urlparams)
         self.w(u'<div style="width: %spx; height: %spx;" class="widget gmap" '
                u'cubicweb:wdgtype="GMapWidget" cubicweb:loadtype="auto" '
                u'cubicweb:loadurl="%s" cubicweb:uselabel="%s"> </div>' % (width, height, loadurl, uselabel))
--- a/web/views/iprogress.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/iprogress.py	Thu Sep 24 00:24:21 2009 +0200
@@ -122,10 +122,10 @@
     def build_eta_date_cell(self, entity):
         """``eta_date`` column cell renderer"""
         if entity.finished():
-            return self.format_date(entity.completion_date())
-        formated_date = self.format_date(entity.initial_prevision_date())
+            return self._cw.format_date(entity.completion_date())
+        formated_date = self._cw.format_date(entity.initial_prevision_date())
         if entity.in_progress():
-            eta_date = self.format_date(entity.eta_date())
+            eta_date = self._cw.format_date(entity.eta_date())
             _ = self._cw._
             if formated_date:
                 formated_date += u' (%s %s)' % (_('expected:'), eta_date)
--- a/web/views/owl.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/owl.py	Thu Sep 24 00:24:21 2009 +0200
@@ -208,4 +208,4 @@
     title = _('download schema as owl')
 
     def url(self):
-        return self.build_url('view', vid='owl')
+        return self._cw.build_url('view', vid='owl')
--- a/web/views/sparql.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/sparql.py	Thu Sep 24 00:24:21 2009 +0200
@@ -52,7 +52,7 @@
             except xy.UnsupportedVocabulary, ex:
                 self.w(self._cw._('unknown vocabulary:') + u' ' + unicode('ex'))
             if vid == 'sparqlxml':
-                url = self.build_url('view', rql=qinfo.finalize(), vid=vid)
+                url = self._cw.build_url('view', rql=qinfo.finalize(), vid=vid)
                 raise Redirect(url)
             rset = self._cw.execute(qinfo.finalize())
             self.wview(vid, rset, 'null')
--- a/web/views/startup.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/startup.py	Thu Sep 24 00:24:21 2009 +0200
@@ -125,7 +125,7 @@
             etype = eschema.type
             label = display_name(req, etype, 'plural')
             nb = req.execute('Any COUNT(X) WHERE X is %s' % etype)[0][0]
-            url = self.build_url(etype)
+            url = self._cw.build_url(etype)
             etypelink = u'&#160;<a href="%s">%s</a> (%d)' % (
                 xml_escape(url), label, nb)
             yield (label, etypelink, self.add_entity_link(eschema, req))
--- a/web/views/tabs.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/tabs.py	Thu Sep 24 00:24:21 2009 +0200
@@ -47,7 +47,7 @@
         elif rset:
             urlparams['rql'] = rset.printable_rql()
         w(u'<div id="lazy-%s" cubicweb:loadurl="%s">' % (
-            vid, xml_escape(self.build_url('json', **urlparams))))
+            vid, xml_escape(self._cw.build_url('json', **urlparams))))
         if show_spinbox:
             w(u'<img src="data/loading.gif" id="%s-hole" alt="%s"/>'
               % (vid, self._cw._('loading')))
--- a/web/views/timeline.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/timeline.py	Thu Sep 24 00:24:21 2009 +0200
@@ -109,7 +109,7 @@
     def call(self, tlunit=None):
         self._cw.html_headers.define_var('Timeline_urlPrefix', self._cw.datadir_url)
         rql = self.cw_rset.printable_rql()
-        loadurl = self.build_url(rql=rql, vid='timeline-json')
+        loadurl = self._cw.build_url(rql=rql, vid='timeline-json')
         self.render_url(loadurl, tlunit)
 
 
--- a/web/views/timetable.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/timetable.py	Thu Sep 24 00:24:21 2009 +0200
@@ -171,7 +171,7 @@
             odd = not odd
 
             if not empty_line:
-                self.w(u'<th class="ttdate">%s</th>' % self.format_date(date) )
+                self.w(u'<th class="ttdate">%s</th>' % self._cw.format_date(date) )
             else:
                 self.w(u'<th>...</th>'  )
                 previous_is_empty = True
--- a/web/views/treeview.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/treeview.py	Thu Sep 24 00:24:21 2009 +0200
@@ -142,12 +142,12 @@
             w(u'<li class="%s">' % u' '.join(liclasses))
         else:
             rql = entity.children_rql() % {'x': entity.eid}
-            url = xml_escape(self.build_url('json', rql=rql, vid=parentvid,
-                                            pageid=self._cw.pageid,
-                                            treeid=treeid,
-                                            fname='view',
-                                            treesubvid=vid,
-                                            morekwargs=json.dumps(morekwargs)))
+            url = xml_escape(self._cw.build_url('json', rql=rql, vid=parentvid,
+                                                pageid=self._cw.pageid,
+                                                treeid=treeid,
+                                                fname='view',
+                                                treesubvid=vid,
+                                                morekwargs=json.dumps(morekwargs)))
             divclasses = ['hitarea']
             if is_open:
                 liclasses.append('collapsable')
--- a/web/views/vcard.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/vcard.py	Thu Sep 24 00:24:21 2009 +0200
@@ -28,7 +28,7 @@
 
     def cell_call(self, row, col):
         self.vcard_header()
-        self.vcard_content(self.complete_entity(row, col))
+        self.vcard_content(self.cw_rset.complete_entity(row, col))
         self.vcard_footer()
 
     def vcard_header(self):
--- a/web/views/wdoc.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/wdoc.py	Thu Sep 24 00:24:21 2009 +0200
@@ -224,7 +224,7 @@
         i = 0
         for edate, messages in reversed(allentries):
             if latestdate != edate:
-                fdate = self.format_date(edate)
+                fdate = self._cw.format_date(edate)
                 w(u'\n%s' % fdate)
                 w('~' * len(fdate))
                 latestdate = edate
--- a/web/views/workflow.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/workflow.py	Thu Sep 24 00:24:21 2009 +0200
@@ -178,8 +178,8 @@
     __select__ = implements('State')
 
     def cell_call(self, row, col):
-        self.w(xml_escape(self.view('textincontext', self.cw_rset,
-                                     row=row, col=col)))
+        self.w(xml_escape(self._cw.view('textincontext', self.cw_rset,
+                                        row=row, col=col)))
 
 
 class WorkflowPrimaryView(primary.PrimaryView):
--- a/web/views/xmlrss.py	Thu Sep 24 00:23:32 2009 +0200
+++ b/web/views/xmlrss.py	Thu Sep 24 00:24:21 2009 +0200
@@ -109,7 +109,7 @@
     __select__ = non_final_entity()
 
     def feed_url(self):
-        return self._cw.build_url(rql=self.limited_rql(), vid='rss')
+        return self._cw.build_url(rql=self.cw_rset.limited_rql(), vid='rss')
 
 
 class RSSEntityFeedURL(Component):