--- a/appobject.py Thu Aug 13 11:49:56 2009 +0200
+++ b/appobject.py Thu Aug 13 11:54:19 2009 +0200
@@ -245,7 +245,7 @@
return '%s.%s' % (cls.__module__, cls.__name__)
@classmethod
- def registered(cls, registry):
+ def __registered__(cls, registry):
"""called by the registry when the appobject has been registered.
It must return the object that will be actually registered (this may be
--- a/server/hooksmanager.py Thu Aug 13 11:49:56 2009 +0200
+++ b/server/hooksmanager.py Thu Aug 13 11:54:19 2009 +0200
@@ -217,8 +217,8 @@
self.event = event
@classmethod
- def registered(cls, vreg):
- super(Hook, cls).registered(vreg)
+ def __registered__(cls, vreg):
+ super(Hook, cls).__registered__(vreg)
return cls()
@classmethod
--- a/vregistry.py Thu Aug 13 11:49:56 2009 +0200
+++ b/vregistry.py Thu Aug 13 11:54:19 2009 +0200
@@ -78,9 +78,7 @@
appobjects = self[oid] = []
else:
appobjects = self.setdefault(oid, [])
- # registered() is technically a classmethod but is not declared
- # as such because we need to compose registered in some cases
- appobject = obj.registered.im_func(obj, self)
+ appobject = obj.__registered__(self)
assert not appobject in appobjects, \
'object %s is already registered' % appobject
assert callable(appobject.__select__), appobject
--- a/web/views/actions.py Thu Aug 13 11:49:56 2009 +0200
+++ b/web/views/actions.py Thu Aug 13 11:54:19 2009 +0200
@@ -158,14 +158,13 @@
order = 15
@classmethod
- def registered(cls, vreg):
- super(ManagePermissionsAction, cls).registered(vreg)
+ def __registered__(cls, vreg):
if 'require_permission' in vreg.schema:
cls.__select__ = (one_line_rset() & non_final_entity() &
(match_user_groups('managers')
| relation_possible('require_permission', 'subject', 'CWPermission',
action='add')))
- return super(ManagePermissionsAction, cls).registered(vreg)
+ return super(ManagePermissionsAction, cls).__registered__(vreg)
def url(self):
return self.rset.get_entity(self.row or 0, self.col or 0).absolute_url(vid='security')