app/soc/views/site/docs/list.py
changeset 313 c25b1b680ba7
parent 309 7190b224c701
child 316 9efdc7bc3565
equal deleted inserted replaced
312:3488234b329f 313:c25b1b680ba7
    21   '"Todd Larsen" <tlarsen@google.com>',
    21   '"Todd Larsen" <tlarsen@google.com>',
    22   ]
    22   ]
    23 
    23 
    24 
    24 
    25 import soc.logic
    25 import soc.logic
    26 from soc.logic import models
    26 from soc.logic.models import work
    27 import soc.models.document
    27 import soc.models.document
    28 from soc.views import simple
    28 from soc.views import simple
    29 from soc.views import helper
    29 from soc.views import helper
    30 from soc.views.helper import access
    30 from soc.views.helper import access
    31 import soc.views.helper.lists
    31 import soc.views.helper.lists
    59 
    59 
    60   offset, limit = helper.lists.cleanListParameters(
    60   offset, limit = helper.lists.cleanListParameters(
    61       offset=request.GET.get('offset'), limit=request.GET.get('limit'))
    61       offset=request.GET.get('offset'), limit=request.GET.get('limit'))
    62 
    62 
    63   # Fetch one more to see if there should be a 'next' link
    63   # Fetch one more to see if there should be a 'next' link
    64   docs = models.work.logic.getForLimitAndOffset(limit + 1, offset=offset)
    64   docs = work.logic.getForLimitAndOffset(limit + 1, offset=offset)
    65 
    65 
    66   context['pagination_form'] = helper.lists.makePaginationForm(request, limit)
    66   context['pagination_form'] = helper.lists.makePaginationForm(request, limit)
    67 
    67 
    68   list_templates = {'list_main': 'soc/list/list_main.html',
    68   list_templates = {'list_main': 'soc/list/list_main.html',
    69                     'list_pagination': 'soc/list/list_pagination.html',
    69                     'list_pagination': 'soc/list/list_pagination.html',