each subclass of EntitySelector should call its __init__ method tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 18 Feb 2009 11:40:25 +0100
branchtls-sprint
changeset 770 193b7e981ea9
parent 769 2b49c9932d8c
child 771 ae1b0081ff30
each subclass of EntitySelector should call its __init__ method
selectors.py
--- a/selectors.py	Wed Feb 18 11:38:05 2009 +0100
+++ b/selectors.py	Wed Feb 18 11:40:25 2009 +0100
@@ -634,7 +634,8 @@
                  'object', default to 'subject'.
     """
     
-    def __init__(self, rtype, role='subject'):
+    def __init__(self, rtype, role='subject', once_is_enough=False):
+        super(may_add_relation, self).__init__(once_is_enough)
         self.rtype = rtype
         self.role = role
         
@@ -663,10 +664,10 @@
     """
     def __init__(self, rtype, role='subject', target_etype=None,
                  once_is_enough=False):
+        super(has_related_entities, self).__init__(once_is_enough)
         self.rtype = rtype
         self.role = role
         self.target_etype = target_etype
-        self.once_is_enough = once_is_enough
     
     def score_entity(self, entity):
         rset = entity.related(self.rtype, self.role)
@@ -689,7 +690,8 @@
     
     :param action: an entity schema action (eg 'read'/'add'/'delete'/'update')
     """
-    def __init__(self, action):
+    def __init__(self, action, once_is_enough=False):
+        super(has_permission, self).__init__(once_is_enough)
         self.action = action
         
     @lltrace
@@ -782,6 +784,7 @@
     :param *etypes: entity types (`basestring`) which should be refused
     """
     def __init__(self, *etypes):
+        super(but_etype, self).__init__()
         self.but_etypes = etypes
         
     def score(self, req, rset, row, col):