def search(request, tid): test = get_object_or_404(Test, id=tid) templates = Finding_Template.objects.all() templates = TemplateFindingFilter(request.GET, queryset=templates) paged_templates = get_page_items(request, templates.qs, 25) title_words = get_words_for_field(Finding_Template, 'title') add_breadcrumb(parent=test, title="Add From Template", top_level=False, request=request) return render( request, 'dojo/templates.html', { 'templates': paged_templates, 'filtered': templates, 'title_words': title_words, 'tid': tid, 'add_from_template': True, })
def search(request, tid): test = get_object_or_404(Test, id=tid) templates = Finding_Template.objects.all() templates = TemplateFindingFilter(request.GET, queryset=templates) paged_templates = get_page_items(request, templates, 25) title_words = [ word for finding in templates for word in finding.title.split() if len(word) > 2 ] title_words = sorted(set(title_words)) add_breadcrumb(parent=test, title="Add From Template", top_level=False, request=request) return render( request, 'dojo/templates.html', { 'templates': paged_templates, 'filtered': templates, 'title_words': title_words, 'tid': tid, 'add_from_template': True, })