equal
deleted
inserted
replaced
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 |