comparison sat_pubsub/backend.py @ 296:6ce33757d21e

backend: fixes RSM for "unrestricted" mode
author souliane <souliane@mailoo.org>
date Thu, 10 Sep 2015 15:02:03 +0200
parents df1edebb0466
children 648f294601c2
comparison
equal deleted inserted replaced
295:bed30cef11a8 296:6ce33757d21e
669 d_index.addCallback(lambda index: setattr(response, 'index', index - 1)) 669 d_index.addCallback(lambda index: setattr(response, 'index', index - 1))
670 d_list.append(d_index) 670 d_list.append(d_index)
671 671
672 672
673 def render(result): 673 def render(result):
674 items = [elt for elt in elts if elt.name == 'item'] 674 try:
675 items = [elt for elt in elts if elt.name == 'item']
676 except AttributeError:
677 # XXX: see sat_pubsub.pgsql_storage.LeafNode.getItemsById return value
678 items = [elt[0] for elt in elts if elt[0].name == 'item']
675 if len(items) > 0: 679 if len(items) > 0:
676 if response.index is None: 680 if response.index is None:
677 if request.before == '': # last page 681 if request.before == '': # last page
678 response.index = response.count - request.max 682 response.index = response.count - request.max
679 else: # first page 683 else: # first page