def history(request, branch): """ :param request: :param branch: :return: """ branch_obj = Branch.objects.get(name=branch) items_list = QueueRecord.objects.filter(branch=branch_obj, hidden=False, status__in=[QueueRecord.DONE, QueueRecord.REVERTED, QueueRecord.SKIPPED]).order_by( '-done_date') for item in items_list: item.formatted_duration = str(timedelta(minutes=int(item.push_duration()))) paginator = DiggPaginator(items_list, 15, body=5, padding=1, margin=2) current_page = request.GET.get('page') try: page = paginator.page(current_page) except (TypeError, PageNotAnInteger): page = paginator.page(1) except EmptyPage: page = paginator.page(paginator.num_pages) return render_to_response('history/dpq_history.html', RequestContext(request, {'page': page, 'branch': branch_obj, 'jira_browse_url': JIRA_BROWSE_URL, 'active_branches': get_active_branches()}))
def retro_boards_list(request): boards_list = RetroBoard.objects.all().order_by('-creation_date') paginator = DiggPaginator(boards_list, 15, body=5, padding=1, margin=2) current_page = request.GET.get('page') try: page = paginator.page(current_page) except (TypeError, PageNotAnInteger): page = paginator.page(1) except EmptyPage: page = paginator.page(paginator.num_pages) return render_to_response('retro/dpq_retro.html', RequestContext(request, {'page': page, 'active_branches': get_active_branches()}))