equal
deleted
inserted
replaced
1178 return self._build_descr(result, basedescr, todetermine) |
1178 return self._build_descr(result, basedescr, todetermine) |
1179 |
1179 |
1180 def _build_descr(self, result, basedescription, todetermine): |
1180 def _build_descr(self, result, basedescription, todetermine): |
1181 description = [] |
1181 description = [] |
1182 etype_from_eid = self.describe |
1182 etype_from_eid = self.describe |
1183 for row in result: |
1183 todel = [] |
|
1184 for i, row in enumerate(result): |
1184 row_descr = basedescription[:] |
1185 row_descr = basedescription[:] |
1185 for index, isfinal in todetermine: |
1186 for index, isfinal in todetermine: |
1186 value = row[index] |
1187 value = row[index] |
1187 if value is None: |
1188 if value is None: |
1188 # None value inserted by an outer join, no type |
1189 # None value inserted by an outer join, no type |
1192 row_descr[index] = etype_from_pyobj(value) |
1193 row_descr[index] = etype_from_pyobj(value) |
1193 else: |
1194 else: |
1194 try: |
1195 try: |
1195 row_descr[index] = etype_from_eid(value)[0] |
1196 row_descr[index] = etype_from_eid(value)[0] |
1196 except UnknownEid: |
1197 except UnknownEid: |
1197 self.critical('wrong eid %s in repository, you should ' |
1198 self.error('wrong eid %s in repository, you should ' |
1198 'db-check the database' % value) |
1199 'db-check the database' % value) |
1199 row_descr[index] = row[index] = None |
1200 todel.append(i) |
1200 description.append(tuple(row_descr)) |
1201 break |
|
1202 else: |
|
1203 description.append(tuple(row_descr)) |
|
1204 for i in reversed(todel): |
|
1205 del result[i] |
1201 return description |
1206 return description |
1202 |
1207 |
1203 # deprecated ############################################################### |
1208 # deprecated ############################################################### |
1204 |
1209 |
1205 @deprecated('[3.13] use getattr(session.rtype_eids_rdef(rtype, eidfrom, eidto), prop)') |
1210 @deprecated('[3.13] use getattr(session.rtype_eids_rdef(rtype, eidfrom, eidto), prop)') |