entity.py
branchtls-sprint
changeset 1471 c889c3bcf5ec
parent 1435 6cd6172718bb
child 1474 716f0742ee7f
equal deleted inserted replaced
1470:fbdf66a08fbb 1471:c889c3bcf5ec
    57                 AutomaticEntityForm.rcategories.set_rtag(tag, rtype, role, stype, otype)
    57                 AutomaticEntityForm.rcategories.set_rtag(tag, rtype, role, stype, otype)
    58             elif tag == 'inlineview':
    58             elif tag == 'inlineview':
    59                 AutomaticEntityForm.rinlined.set_rtag(True, rtype, role, stype, otype)
    59                 AutomaticEntityForm.rinlined.set_rtag(True, rtype, role, stype, otype)
    60             else:
    60             else:
    61                 raise ValueError(tag)
    61                 raise ValueError(tag)
    62             
    62 
    63 except ImportError:
    63 except ImportError:
    64     AutomaticEntityForm = None
    64     AutomaticEntityForm = None
    65     
    65     
    66     def dispatch_rtags(*args):
    66     def dispatch_rtags(*args):
    67         pass
    67         pass
   274                                             user, ordermethod, visited=visited)
   274                                             user, ordermethod, visited=visited)
   275             orderterm = getattr(cls, ordermethod)(attr, var)
   275             orderterm = getattr(cls, ordermethod)(attr, var)
   276             if orderterm:
   276             if orderterm:
   277                 orderby.append(orderterm)
   277                 orderby.append(orderterm)
   278         return selection, orderby, restrictions
   278         return selection, orderby, restrictions
       
   279 
       
   280     @classmethod
       
   281     @cached
       
   282     def parent_classes(cls):
       
   283         parents = [cls.vreg.etype_class(e.type) for e in cls.e_schema.ancestors()]
       
   284         parents.append(cls.vreg.etype_class('Any'))
       
   285         return parents
   279 
   286 
   280     def __init__(self, req, rset=None, row=None, col=0):
   287     def __init__(self, req, rset=None, row=None, col=0):
   281         AppRsetObject.__init__(self, req, rset, row, col)
   288         AppRsetObject.__init__(self, req, rset, row, col)
   282         dict.__init__(self)
   289         dict.__init__(self)
   283         self._related_cache = {}
   290         self._related_cache = {}