entity.py
branchstable
changeset 5522 6be95896d49e
parent 5426 0d4853a6e5ee
child 5556 9ab2b4c74baf
child 5733 d00d1fab42af
equal deleted inserted replaced
5521:4c53a0cb186c 5522:6be95896d49e
   430         self.e_schema.check_perm(self._cw, action, eid=self.eid)
   430         self.e_schema.check_perm(self._cw, action, eid=self.eid)
   431 
   431 
   432     def has_perm(self, action):
   432     def has_perm(self, action):
   433         return self.e_schema.has_perm(self._cw, action, eid=self.eid)
   433         return self.e_schema.has_perm(self._cw, action, eid=self.eid)
   434 
   434 
   435     def view(self, __vid, __registry='views', **kwargs):
   435     def view(self, __vid, __registry='views', w=None, **kwargs):
   436         """shortcut to apply a view on this entity"""
   436         """shortcut to apply a view on this entity"""
   437         view = self._cw.vreg[__registry].select(__vid, self._cw, rset=self.cw_rset,
   437         view = self._cw.vreg[__registry].select(__vid, self._cw, rset=self.cw_rset,
   438                                                 row=self.cw_row, col=self.cw_col,
   438                                                 row=self.cw_row, col=self.cw_col,
   439                                                 **kwargs)
   439                                                 **kwargs)
   440         return view.render(row=self.cw_row, col=self.cw_col, **kwargs)
   440         return view.render(row=self.cw_row, col=self.cw_col, w=w, **kwargs)
   441 
   441 
   442     def absolute_url(self, *args, **kwargs):
   442     def absolute_url(self, *args, **kwargs):
   443         """return an absolute url to view this entity"""
   443         """return an absolute url to view this entity"""
   444         # use *args since we don't want first argument to be "anonymous" to
   444         # use *args since we don't want first argument to be "anonymous" to
   445         # avoid potential clash with kwargs
   445         # avoid potential clash with kwargs