comparison roundup/hyperdb.py @ 4850:6998ad77841e

Fix bug in SQL generation Fix subtle bug when sorting by a Link that contains a Multilink from which we also search for an attribute. In that case the LEFT OUTER JOIN clause was missing in generated SQL.
author Ralf Schlatterbeck <rsc@runtux.com>
date Wed, 18 Dec 2013 09:02:40 +0100
parents 4960a2c21590
children 2ba982dcdf2c
comparison
equal deleted inserted replaced
4849:e68920390aad 4850:6998ad77841e
370 def compute_sort_done(self, mlseen=False): 370 def compute_sort_done(self, mlseen=False):
371 """ Recursively check if attribute is needed for sorting 371 """ Recursively check if attribute is needed for sorting
372 ('sort' in self.need_for) or all children have tree_sort_done set and 372 ('sort' in self.need_for) or all children have tree_sort_done set and
373 sort_ids_needed unset: set self.tree_sort_done if one of the conditions 373 sort_ids_needed unset: set self.tree_sort_done if one of the conditions
374 holds. Also remove sort_ids_needed recursively once having seen a 374 holds. Also remove sort_ids_needed recursively once having seen a
375 Multilink. 375 Multilink that is used for sorting.
376 """ 376 """
377 if isinstance (self.propclass, Multilink): 377 if isinstance (self.propclass, Multilink) and 'sort' in self.need_for:
378 mlseen = True 378 mlseen = True
379 if mlseen: 379 if mlseen:
380 self.sort_ids_needed = False 380 self.sort_ids_needed = False
381 self.tree_sort_done = True 381 self.tree_sort_done = True
382 for p in self.children: 382 for p in self.children:

Roundup Issue Tracker: http://roundup-tracker.org/