app/soc/views/site/sponsor/list.py
changeset 337 cb7d22b1e7d8
parent 324 05e21c089be6
child 344 d135c8c09967
equal deleted inserted replaced
336:9d5b8880260f 337:cb7d22b1e7d8
    50 
    50 
    51   offset, limit = helper.lists.cleanListParameters(
    51   offset, limit = helper.lists.cleanListParameters(
    52       offset=request.GET.get('offset'), limit=request.GET.get('limit'))
    52       offset=request.GET.get('offset'), limit=request.GET.get('limit'))
    53   
    53   
    54   # Fetch one more to see if there should be a 'next' link
    54   # Fetch one more to see if there should be a 'next' link
    55   sponsors = models.sponsor.logic.getForLimitAndOffset(limit + 1, offset=offset)
    55   sponsors = models.sponsor.logic.getForLimitAndOffset(limit=limit + 1,
       
    56                                                        offset=offset)
    56 
    57 
    57   context['pagination_form'] = helper.lists.makePaginationForm(request, limit)
    58   context['pagination_form'] = helper.lists.makePaginationForm(request, limit)
    58   
    59   
    59   list_templates = {'list_main': 'soc/list/list_main.html',
    60   list_templates = {'list_main': 'soc/list/list_main.html',
    60                     'list_pagination': 'soc/list/list_pagination.html',
    61                     'list_pagination': 'soc/list/list_pagination.html',
    61                     'list_row': 'soc/group/list/group_row.html',
    62                     'list_row': 'soc/group/list/group_row.html',
    62                     'list_heading': 'soc/group/list/group_heading.html'}
    63                     'list_heading': 'soc/group/list/group_heading.html'}
    63                       
    64                       
    64   context = helper.lists.setList(request, context, sponsors, 
    65   context = helper.lists.setList(request, context, sponsors, 
    65                                  offset, limit, list_templates)
    66                                  offset=offset, limit=limit, 
       
    67                                  list_templates=list_templates)
    66                                  
    68                                  
    67   context['group_type'] = 'Sponsor'
    69   context['group_type'] = 'Sponsor'
    68 
    70 
    69   return helper.responses.respond(request, template, context)
    71   return helper.responses.respond(request, template, context)