use ._cw instead of .req (reintroduced by merge of stable)
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Dec 2009 13:14:34 +0100
changeset 4183 b5aa030bb2f9
parent 4182 b7cf0ebdd8b6
child 4184 7002e91d304a
use ._cw instead of .req (reintroduced by merge of stable)
web/htmlwidgets.py
web/views/forms.py
web/views/startup.py
--- a/web/htmlwidgets.py	Tue Dec 22 13:13:53 2009 +0100
+++ b/web/htmlwidgets.py	Tue Dec 22 13:14:34 2009 +0100
@@ -288,8 +288,8 @@
 
     When using remember to include the required css and js with:
 
-    self.req.add_js('jquery.tablesorter.js')
-    self.req.add_css(('cubicweb.tablesorter.css', 'cubicweb.tableview.css'))
+    self._cw.add_js('jquery.tablesorter.js')
+    self._cw.add_css(('cubicweb.tablesorter.css', 'cubicweb.tableview.css'))
     """
     highlight = "onmouseover=\"addElementClass(this, 'highlighted');\" " \
                 "onmouseout=\"removeElementClass(this, 'highlighted');\""
--- a/web/views/forms.py	Tue Dec 22 13:13:53 2009 +0100
+++ b/web/views/forms.py	Tue Dec 22 13:14:34 2009 +0100
@@ -227,9 +227,9 @@
             return self.force_session_key
         # XXX if this is a json request, suppose we should redirect to the
         # entity primary view
-        if self.req.json_request and self.edited_entity.has_eid():
+        if self._cw.json_request and self.edited_entity.has_eid():
             return '%s#%s' % (self.edited_entity.absolute_url(), self.domid)
-        return '%s#%s' % (self.req.url(), self.domid)
+        return '%s#%s' % (self._cw.url(), self.domid)
 
     def build_context(self, formvalues=None):
         super(EntityFieldsForm, self).build_context(formvalues)
--- a/web/views/startup.py	Tue Dec 22 13:13:53 2009 +0100
+++ b/web/views/startup.py	Tue Dec 22 13:14:34 2009 +0100
@@ -73,10 +73,10 @@
         self.w(u'<ul class="createLink">')
         for etype in self.add_etype_links:
             eschema = self.schema.eschema(etype)
-            if eschema.has_perm(self.req, 'add'):
+            if eschema.has_perm(self._cw, 'add'):
                 self.w(u'<li><a href="%s">%s</a></li>' % (
-                        self.req.build_url('add/%s' % eschema),
-                        self.req.__('add a %s' % eschema).capitalize()))
+                        self._cw.build_url('add/%s' % eschema),
+                        self._cw.__('add a %s' % eschema).capitalize()))
         self.w(u'</ul>')
 
     def startup_views(self):