web/views/__init__.py
changeset 3720 5376aaadd16b
parent 3451 6b46d73823f5
parent 3689 deb13e88e037
child 4252 6c4f109c2b03
equal deleted inserted replaced
3678:29f74716fd70 3720:5376aaadd16b
    37         # check the selected index node is a VariableRef (else we
    37         # check the selected index node is a VariableRef (else we
    38         # won't detect aggregate function
    38         # won't detect aggregate function
    39         if not isinstance(selected[i+1], nodes.VariableRef):
    39         if not isinstance(selected[i+1], nodes.VariableRef):
    40             return True
    40             return True
    41         # if this is not a final entity
    41         # if this is not a final entity
    42         if not schema.eschema(etype).is_final():
    42         if not schema.eschema(etype).final:
    43             return True
    43             return True
    44         # if this is a final entity not linked to the main variable
    44         # if this is a final entity not linked to the main variable
    45         var = selected[i+1].variable
    45         var = selected[i+1].variable
    46         for vref in var.references():
    46         for vref in var.references():
    47             rel = vref.relation()
    47             rel = vref.relation()
    72     nb_rows = len(rset)
    72     nb_rows = len(rset)
    73     # empty resultset
    73     # empty resultset
    74     if nb_rows == 0 :
    74     if nb_rows == 0 :
    75         return 'noresult'
    75         return 'noresult'
    76     # entity result set
    76     # entity result set
    77     if not schema.eschema(rset.description[0][0]).is_final():
    77     if not schema.eschema(rset.description[0][0]).final:
    78         if need_table_view(rset, schema):
    78         if need_table_view(rset, schema):
    79             return 'table'
    79             return 'table'
    80         if nb_rows == 1:
    80         if nb_rows == 1:
    81             if req.search_state[0] == 'normal':
    81             if req.search_state[0] == 'normal':
    82                 return 'primary'
    82                 return 'primary'