server/ssplanner.py
changeset 3720 5376aaadd16b
parent 3648 665c37544060
parent 3689 deb13e88e037
child 4252 6c4f109c2b03
equal deleted inserted replaced
3678:29f74716fd70 3720:5376aaadd16b
    73                 rtype, term, reverse = rdefs[i]
    73                 rtype, term, reverse = rdefs[i]
    74                 select.append_selected(term.copy(select))
    74                 select.append_selected(term.copy(select))
    75                 if reverse:
    75                 if reverse:
    76                     rdefs[i] = rtype, RelationsStep.REVERSE_RELATION
    76                     rdefs[i] = rtype, RelationsStep.REVERSE_RELATION
    77                 else:
    77                 else:
    78                     rschema = eschema.subject_relation(rtype)
    78                     rschema = eschema.subjrels[rtype]
    79                     if rschema.is_final() or rschema.inlined:
    79                     if rschema.final or rschema.inlined:
    80                         rdefs[i] = rtype, RelationsStep.FINAL
    80                         rdefs[i] = rtype, RelationsStep.FINAL
    81                     else:
    81                     else:
    82                         rdefs[i] = rtype, RelationsStep.RELATION
    82                         rdefs[i] = rtype, RelationsStep.RELATION
    83             if restriction is not None:
    83             if restriction is not None:
    84                 select.set_where(restriction.copy(select))
    84                 select.set_where(restriction.copy(select))
   145             if not rhs.as_string('utf-8') in selected_index:
   145             if not rhs.as_string('utf-8') in selected_index:
   146                 select.append_selected(rhs.copy(select))
   146                 select.append_selected(rhs.copy(select))
   147                 selected_index[rhs.as_string('utf-8')] = index
   147                 selected_index[rhs.as_string('utf-8')] = index
   148                 index += 1
   148                 index += 1
   149             rschema = getrschema(relation.r_type)
   149             rschema = getrschema(relation.r_type)
   150             if rschema.is_final() or rschema.inlined:
   150             if rschema.final or rschema.inlined:
   151                 attrrelations.append(relation)
   151                 attrrelations.append(relation)
   152             else:
   152             else:
   153                 relations.append(relation)
   153                 relations.append(relation)
   154         # add step necessary to fetch all selected variables values
   154         # add step necessary to fetch all selected variables values
   155         if rqlst.where is not None:
   155         if rqlst.where is not None: