common/mixins.py
changeset 3426 6ea4a2ff01c9
parent 3023 7864fee8b4ec
child 3451 6b46d73823f5
equal deleted inserted replaced
3425:4035fc72d73c 3426:6ea4a2ff01c9
   153     def is_root(self):
   153     def is_root(self):
   154         return self.parent() is None
   154         return self.parent() is None
   155 
   155 
   156     def root(self):
   156     def root(self):
   157         """return the root object"""
   157         """return the root object"""
   158         return self.req.entity_from_eid(self.path()[0])
   158         return self._cw.entity_from_eid(self.path()[0])
   159 
   159 
   160 
   160 
   161 class EmailableMixIn(object):
   161 class EmailableMixIn(object):
   162     """base mixin providing the default get_email() method used by
   162     """base mixin providing the default get_email() method used by
   163     the massmailing view
   163     the massmailing view
   207     """handle an infinite recursion safety belt"""
   207     """handle an infinite recursion safety belt"""
   208     if done is None:
   208     if done is None:
   209         done = set()
   209         done = set()
   210     entity = view.rset.get_entity(row, col)
   210     entity = view.rset.get_entity(row, col)
   211     if entity.eid in done:
   211     if entity.eid in done:
   212         msg = entity.req._('loop in %(rel)s relation (%(eid)s)') % {
   212         msg = entity._cw._('loop in %(rel)s relation (%(eid)s)') % {
   213             'rel': entity.tree_attribute,
   213             'rel': entity.tree_attribute,
   214             'eid': entity.eid
   214             'eid': entity.eid
   215             }
   215             }
   216         return None, msg
   216         return None, msg
   217     done.add(entity.eid)
   217     done.add(entity.eid)