rset.py
changeset 10187 0df931eb08de
parent 10087 ed0b076c119b
parent 10180 ea10572fccfe
child 10313 ae9e23cf8790
equal deleted inserted replaced
10177:7b95eae7669d 10187:0df931eb08de
   519 
   519 
   520     @cached
   520     @cached
   521     def _rset_structure(self, eschema, entity_col):
   521     def _rset_structure(self, eschema, entity_col):
   522         eid_col = col = entity_col
   522         eid_col = col = entity_col
   523         rqlst = self.syntax_tree()
   523         rqlst = self.syntax_tree()
       
   524         get_rschema = eschema.schema.rschema
   524         attr_cols = {}
   525         attr_cols = {}
   525         rel_cols = {}
   526         rel_cols = {}
   526         if rqlst.TYPE == 'select':
   527         if rqlst.TYPE == 'select':
   527             # UNION query, find the subquery from which this entity has been
   528             # UNION query, find the subquery from which this entity has been
   528             # found
   529             # found
   530         else:
   531         else:
   531             select = rqlst
   532             select = rqlst
   532         # take care, due to outer join support, we may find None
   533         # take care, due to outer join support, we may find None
   533         # values for non final relation
   534         # values for non final relation
   534         for i, attr, role in attr_desc_iterator(select, col, entity_col):
   535         for i, attr, role in attr_desc_iterator(select, col, entity_col):
   535             if role == 'subject':
   536             rschema = get_rschema(attr)
   536                 rschema = eschema.subjrels[attr]
       
   537             else:
       
   538                 rschema = eschema.objrels[attr]
       
   539             if rschema.final:
   537             if rschema.final:
   540                 if attr == 'eid':
   538                 if attr == 'eid':
   541                     eid_col = i
   539                     eid_col = i
   542                 else:
   540                 else:
   543                     attr_cols[attr] = i
   541                     attr_cols[attr] = i