more api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Dec 2009 16:05:01 +0100
changeset 4084 69739e6ebd2a
parent 4083 3b285889b8e9
child 4085 002ba2a3bb13
more api update
web/test/unittest_formfields.py
web/views/magicsearch.py
web/views/massmailing.py
--- a/web/test/unittest_formfields.py	Wed Dec 09 15:47:01 2009 +0100
+++ b/web/test/unittest_formfields.py	Wed Dec 09 16:05:01 2009 +0100
@@ -104,7 +104,7 @@
         self.assertEquals(field.required, False)
         self.assertEquals(field.initial(None), None)
         self.assertIsInstance(field.widget, Radio)
-        self.assertEquals(field.vocabulary(mock(req=mock(_=unicode))),
+        self.assertEquals(field.vocabulary(mock(_cw=mock(_=unicode))),
                           [(u'yes', '1'), (u'no', '')])
 
     def test_bool_field_explicit_choices(self):
--- a/web/views/magicsearch.py	Wed Dec 09 15:47:01 2009 +0100
+++ b/web/views/magicsearch.py	Wed Dec 09 16:05:01 2009 +0100
@@ -174,7 +174,7 @@
         rqlst = parse(uquery, print_errors=False)
         schema = self._cw.vreg.schema
         # rql syntax tree will be modified in place if necessary
-        translate_rql_tree(rqlst, trmap(self._cw.config, schema, self._cw.lang),
+        translate_rql_tree(rqlst, trmap(self._cw.vreg.config, schema, self._cw.lang),
                            schema)
         return rqlst.as_string(),
 
@@ -211,7 +211,7 @@
         """
         etype = word.capitalize()
         try:
-            return trmap(self._cw.config, self._cw.vreg.schema, self._cw.lang)[etype]
+            return trmap(self._cw.vreg.config, self._cw.vreg.schema, self._cw.lang)[etype]
         except KeyError:
             raise BadRQLQuery('%s is not a valid entity name' % etype)
 
@@ -223,7 +223,7 @@
         # Need to convert from unicode to string (could be whatever)
         rtype = word.lower()
         # Find the entity name as stored in the DB
-        translations = trmap(self._cw.config, self._cw.vreg.schema, self._cw.lang)
+        translations = trmap(self._cw.vreg.config, self._cw.vreg.schema, self._cw.lang)
         try:
             translations = translations[rtype]
         except KeyError:
--- a/web/views/massmailing.py	Wed Dec 09 15:47:01 2009 +0100
+++ b/web/views/massmailing.py	Wed Dec 09 16:05:01 2009 +0100
@@ -49,7 +49,7 @@
                               _('send email'), 'SEND_EMAIL_ICON'),
                     ImgButton('cancelbutton', "javascript: history.back()",
                               stdmsgs.BUTTON_CANCEL, 'CANCEL_EMAIL_ICON')]
-    form_renderer_id = id
+    form_renderer_id = __regid__
 
     def form_field_vocabulary(self, field):
         if field.name == 'recipient':