3.2 update
authorsylvain.thenault@logilab.fr
Thu, 30 Apr 2009 09:37:33 +0200
changeset 17 ca5839227688
parent 16 a6db8ae22525
child 18 2c1498561959
3.2 update
hooks.py
test/unittest_classification.py
test/unittest_security.py
views.py
--- a/hooks.py	Fri Jan 30 15:33:41 2009 +0100
+++ b/hooks.py	Thu Apr 30 09:37:33 2009 +0200
@@ -141,7 +141,7 @@
     msgid_timestamp = True
 
     def recipients(self):
-        dests = [add for add, in self.req.execute('Any A WHERE X is EUser, X in_group G,'
+        dests = [add for add, in self.req.execute('Any A WHERE X is CWUser, X in_group G,'
                                                   'G name "managers", X in_state S, S name "activated",'
                                                   'X primary_email E, E address A')]
         if not dests:
--- a/test/unittest_classification.py	Fri Jan 30 15:33:41 2009 +0100
+++ b/test/unittest_classification.py	Thu Apr 30 09:37:33 2009 +0200
@@ -6,15 +6,15 @@
 class ClassificationHooksTC(EnvBasedTC):
 
     def setup_database(self):
-        self.execute('INSERT Classification C: C name "classif1", C classifies ET WHERE ET name "EGroup"')
-        self.execute('INSERT Classification C: C name "classif2", C classifies ET WHERE ET name "EUser"')
+        self.execute('INSERT Classification C: C name "classif1", C classifies ET WHERE ET name "CWGroup"')
+        self.execute('INSERT Classification C: C name "classif2", C classifies ET WHERE ET name "CWUser"')
         self.kw1 = self.execute('INSERT Keyword K: K name "kwgroup", K included_in C WHERE C name "classif1"')[0][0]
         self.kw2 = self.execute('INSERT Keyword K: K name "kwuser", K included_in C WHERE C name "classif2"')[0][0]
         #self.zone = self.add_entity('Zone', name=u"Paris")
     
     def test_application_of_bad_keyword_fails(self):
         self.assertRaises(ValidationError, self.execute,
-                          'SET K applied_to G WHERE G is EGroup, K name "kwuser"')
+                          'SET K applied_to G WHERE G is CWGroup, K name "kwuser"')
 
 
     def test_creating_a_new_subkeyword_sets_included_in(self):
@@ -78,7 +78,7 @@
 class KeywordTC(EnvBasedTC):
     def setup_database(self):
         self.classif = self.add_entity(u'Classification', name=u'theclassif')
-        self.execute('SET C classifies ET WHERE C eid %(c)s, ET name "EUser"',
+        self.execute('SET C classifies ET WHERE C eid %(c)s, ET name "CWUser"',
                      {'c' : self.classif.eid})
 
 
--- a/test/unittest_security.py	Fri Jan 30 15:33:41 2009 +0100
+++ b/test/unittest_security.py	Thu Apr 30 09:37:33 2009 +0200
@@ -3,7 +3,7 @@
 class SecurityTC(EnvBasedTC):
 
     def setup_database(self):
-        self.execute('INSERT Classification C: C name "classif1", C classifies ET WHERE ET name "EGroup"')
+        self.execute('INSERT Classification C: C name "classif1", C classifies ET WHERE ET name "CWGroup"')
         self.kw1 = self.execute('INSERT Keyword K: K name "kwgroup", K included_in C WHERE C name "classif1"')[0][0]
 
     def test_nonregr_keyword_selection_as_guest(self):
--- a/views.py	Fri Jan 30 15:33:41 2009 +0100
+++ b/views.py	Thu Apr 30 09:37:33 2009 +0200
@@ -12,10 +12,14 @@
 
 from cubicweb.common.mixins import TreePathMixIn
 from cubicweb.common.view import EntityView
-from cubicweb.web import stdmsgs
+from cubicweb.web import stdmsgs, uicfg
 from cubicweb.web.component import EntityVComponent
 from cubicweb.web.views import baseviews
 
+# displayed by the above component
+uicfg.rdisplay.tag_relation({}, ('*', 'applied_to', '*'), 'object')
+uicfg.rdisplay.tag_relation({}, ('*', 'applied_to', '*'), 'subject')
+
 # keyword views ###############################################################
 
 class KeywordPrimaryView(baseviews.PrimaryView):
@@ -112,10 +116,6 @@
         self.w(u'<td><div id="kwformholder"></div>')
         self.w(u'</td></tr></table>')
 
-# displayed by the above component
-baseviews.PRIMARY_SKIP_RELS.add('applied_to') 
-
-
 # add some classification schema related methods to the Jsoncontroller ########
 
 from cubicweb.web.views.basecontrollers import JSonController