# HG changeset patch # User Sverre Rabbelier # Date 1235301499 0 # Node ID 2584724403ffec39e7e27cc09c84d8a708274961 # Parent ec06d3ee73e4628edb1413c15cc6a9a0fc88e4c3 Make it possible not to generate empty lists Patch by: Sverre Rabbelier diff -r ec06d3ee73e4 -r 2584724403ff app/soc/views/helper/lists.py --- a/app/soc/views/helper/lists.py Sun Feb 22 11:17:46 2009 +0000 +++ b/app/soc/views/helper/lists.py Sun Feb 22 11:18:19 2009 +0000 @@ -100,7 +100,7 @@ return request.path + link_suffix -def getListContent(request, params, filter=None, idx=0): +def getListContent(request, params, filter=None, idx=0, need_content=False): """Returns a dict with fields used for rendering lists. Args: @@ -138,6 +138,9 @@ # Fetch one more to see if there should be a 'next' link data = logic.getForFields(filter=filter, limit=limit+1, offset=offset) + if need_content and not data: + return None + more = len(data) > limit if more: