entity.py
changeset 4049 5838a4b0766d
parent 4023 eae23c40627a
child 4252 6c4f109c2b03
equal deleted inserted replaced
4048:12c4f7e2bed6 4049:5838a4b0766d
   174                 # XXX we need outer join in case the relation is not mandatory
   174                 # XXX we need outer join in case the relation is not mandatory
   175                 # (card == '?')  *or if the entity is being added*, since in
   175                 # (card == '?')  *or if the entity is being added*, since in
   176                 # that case the relation may still be missing. As we miss this
   176                 # that case the relation may still be missing. As we miss this
   177                 # later information here, systematically add it.
   177                 # later information here, systematically add it.
   178                 restrictions[-1] += '?'
   178                 restrictions[-1] += '?'
   179                 # XXX user.req.vreg iiiirk
   179                 # XXX user._cw.vreg iiiirk
   180                 destcls = user._cw.vreg['etypes'].etype_class(desttype)
   180                 destcls = user._cw.vreg['etypes'].etype_class(desttype)
   181                 destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs,
   181                 destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs,
   182                                             selection, orderby, restrictions,
   182                                             selection, orderby, restrictions,
   183                                             user, ordermethod, visited=visited)
   183                                             user, ordermethod, visited=visited)
   184             orderterm = getattr(cls, ordermethod)(attr, var)
   184             orderterm = getattr(cls, ordermethod)(attr, var)
   793 
   793 
   794         Values may be an entity, a list of entity, or None (meaning that all
   794         Values may be an entity, a list of entity, or None (meaning that all
   795         relations of the given type from or to this object should be deleted).
   795         relations of the given type from or to this object should be deleted).
   796         """
   796         """
   797         if _cw_unsafe:
   797         if _cw_unsafe:
   798             execute = self.req.unsafe_execute
   798             execute = self._cw.unsafe_execute
   799         else:
   799         else:
   800             execute = self.req.execute
   800             execute = self._cw.execute
   801         # XXX update cache
   801         # XXX update cache
   802         for attr, values in kwargs.iteritems():
   802         for attr, values in kwargs.iteritems():
   803             if attr.startswith('reverse_'):
   803             if attr.startswith('reverse_'):
   804                 restr = 'Y %s X' % attr[len('reverse_'):]
   804                 restr = 'Y %s X' % attr[len('reverse_'):]
   805             else:
   805             else: