allow to instantiate an entity without rset tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 22 Apr 2009 19:42:44 +0200
branchtls-sprint
changeset 1435 6cd6172718bb
parent 1434 42e57dbbc585
child 1436 97774eb6443b
allow to instantiate an entity without rset
entity.py
web/views/editforms.py
--- a/entity.py	Wed Apr 22 19:42:17 2009 +0200
+++ b/entity.py	Wed Apr 22 19:42:44 2009 +0200
@@ -277,7 +277,7 @@
                 orderby.append(orderterm)
         return selection, orderby, restrictions
 
-    def __init__(self, req, rset, row=None, col=0):
+    def __init__(self, req, rset=None, row=None, col=0):
         AppRsetObject.__init__(self, req, rset, row, col)
         dict.__init__(self)
         self._related_cache = {}
--- a/web/views/editforms.py	Wed Apr 22 19:42:17 2009 +0200
+++ b/web/views/editforms.py	Wed Apr 22 19:42:44 2009 +0200
@@ -482,7 +482,7 @@
         """creation view for an entity"""
         etype = kwargs.pop('etype', self.req.form.get('etype'))
         try:
-            entity = self.vreg.etype_class(etype)(self.req, None, None)
+            entity = self.vreg.etype_class(etype)(self.req)
         except:
             self.w(self.req._('no such entity type %s') % etype)
         else: