fix initializers tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 17 Feb 2009 18:17:32 +0100
branchtls-sprint
changeset 683 4f4a34346e9b
parent 682 d95936d6ce5c
child 684 ddeab9691381
fix initializers
common/appobject.py
common/view.py
--- a/common/appobject.py	Tue Feb 17 17:46:17 2009 +0100
+++ b/common/appobject.py	Tue Feb 17 18:17:32 2009 +0100
@@ -64,15 +64,15 @@
         return cls
 
     @classmethod
-    def selected(cls, req, rset, row=None, col=None, **kwargs):
+    def selected(cls, *args, **kwargs):
         """by default web app objects are usually instantiated on
         selection according to a request, a result set, and optional
         row and col
         """
-        instance = cls(req, rset)
-        instance.row = row
-        instance.col = col
-        instance.sel_kwargs = kwargs
+        instance = cls(*args)
+        instance.row = kwargs.pop('row', None)
+        instance.col = kwargs.pop('col', None)
+        instance.selection_kwargs = kwargs
         return instance
 
     # Eproperties definition:
@@ -100,7 +100,7 @@
         return '%s.%s.%s' % (cls.__registry__, cls.id, propid)
             
         
-    def __init__(self, req, rset):
+    def __init__(self, req=None, rset=None):
         super(AppRsetObject, self).__init__()
         self.req = req
         self.rset = rset
--- a/common/view.py	Tue Feb 17 17:46:17 2009 +0100
+++ b/common/view.py	Tue Feb 17 18:17:32 2009 +0100
@@ -100,7 +100,7 @@
     add_to_breadcrumbs = True
     category = 'view'
 
-    def __init__(self, req, rset):
+    def __init__(self, req=None, rset=None):
         super(View, self).__init__(req, rset)
         self.w = None