comparison roundup/hyperdb.py @ 5871:acc4a128ab9b

Backwards-compatible signature of _proptree method
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 26 Aug 2019 22:45:42 +0200
parents 16e1255b16cf
children cf800f1febe6
comparison
equal deleted inserted replaced
5870:5ae426616576 5871:acc4a128ab9b
1300 """For some backends this implements the non-transitive 1300 """For some backends this implements the non-transitive
1301 search, for more information see the filter method. 1301 search, for more information see the filter method.
1302 """ 1302 """
1303 raise NotImplementedError 1303 raise NotImplementedError
1304 1304
1305 def _proptree(self, exact_match_spec, filterspec, sortattr=[], retr=False): 1305 def _proptree(self, filterspec, exact_match_spec={}, sortattr=[],
1306 retr=False):
1306 """Build a tree of all transitive properties in the given 1307 """Build a tree of all transitive properties in the given
1307 exact_match_spec/filterspec. 1308 exact_match_spec/filterspec.
1308 If we retrieve (retr is True) linked items we don't follow 1309 If we retrieve (retr is True) linked items we don't follow
1309 across multilinks. We also don't follow if the searched value 1310 across multilinks. We also don't follow if the searched value
1310 can contain NULL values. 1311 can contain NULL values.
1456 version can be implemented in the individual backends -- e.g., 1457 version can be implemented in the individual backends -- e.g.,
1457 an SQL backend will want to create a single SQL statement and 1458 an SQL backend will want to create a single SQL statement and
1458 override the filter method instead of implementing _filter. 1459 override the filter method instead of implementing _filter.
1459 """ 1460 """
1460 sortattr = self._sortattr(sort = sort, group = group) 1461 sortattr = self._sortattr(sort = sort, group = group)
1461 proptree = self._proptree(exact_match_spec, filterspec, sortattr) 1462 proptree = self._proptree(filterspec, exact_match_spec, sortattr)
1462 proptree.search(search_matches, retired=retired) 1463 proptree.search(search_matches, retired=retired)
1463 if offset is not None or limit is not None: 1464 if offset is not None or limit is not None:
1464 items = proptree.sort() 1465 items = proptree.sort()
1465 if limit and offset: 1466 if limit and offset:
1466 return items[offset:offset+limit] 1467 return items[offset:offset+limit]

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