change the way selected/__init__ are used for AppRsetObject tls-sprint
authorsylvain.thenault@logilab.fr
Thu, 26 Mar 2009 18:54:26 +0100
branchtls-sprint
changeset 1143 8d097defbf2c
parent 1142 03a9acf3c299
child 1144 654047cd0c30
change the way selected/__init__ are used for AppRsetObject
appobject.py
view.py
--- a/appobject.py	Thu Mar 26 18:53:14 2009 +0100
+++ b/appobject.py	Thu Mar 26 18:54:26 2009 +0100
@@ -70,14 +70,7 @@
         row and col
         """
         assert len(args) <= 2
-#         for key in ('req', 'rset'):
-#             if key in kwargs:
-#                 args += (kwargs.pop(key),)
-        instance = cls(*args)
-        instance.row = kwargs.pop('row', None)
-        instance.col = kwargs.pop('col', None)
-        instance.extra_kwargs = kwargs
-        return instance
+        return cls(*args, **kwargs)
 
     # Eproperties definition:
     # key: id of the property (the actual EProperty key is build using
@@ -113,10 +106,13 @@
             selector = (selector,)
         return selector
     
-    def __init__(self, req=None, rset=None):
+    def __init__(self, req=None, rset=None, row=None, col=None, **extra):
         super(AppRsetObject, self).__init__()
         self.req = req
         self.rset = rset
+        self.row = row
+        self.col = col
+        self.extra_kwargs = extra
         
     def get_cache(self, cachename):
         """
@@ -143,7 +139,6 @@
     def propval(self, propid):
         assert self.req
         return self.req.property_value(self.propkey(propid))
-
     
     def limited_rql(self):
         """return a printable rql for the result set associated to the object,
--- a/view.py	Thu Mar 26 18:53:14 2009 +0100
+++ b/view.py	Thu Mar 26 18:54:26 2009 +0100
@@ -102,8 +102,8 @@
     add_to_breadcrumbs = True
     category = 'view'
 
-    def __init__(self, req=None, rset=None):
-        super(View, self).__init__(req, rset)
+    def __init__(self, req=None, rset=None, **kwargs):
+        super(View, self).__init__(req, rset, **kwargs)
         self.w = None
 
     @property
@@ -361,8 +361,8 @@
 
     default_rql = None
 
-    def __init__(self, req, rset):
-        super(EntityStartupView, self).__init__(req, rset)
+    def __init__(self, req, rset, **kwargs):
+        super(EntityStartupView, self).__init__(req, rset, **kwargs)
         if rset is None:
             # this instance is not in the "entityview" category
             self.category = 'startupview'