(request, uid, template_name="project_info.html", active='info', show_summary=None,
                 extra_context={})
return render(request, template_name, context)
This view handles the project info, data list, recipe list, result list views.
This view handles the project info, data list, recipe list, result list views.
This view handles the project info data list recipe list result list views .
def project_view(request, uid, template_name="project_info.html", active='info', show_summary=None,
                 extra_context={}):
    """
    This view handles the project info, data list, recipe list, result list views.
    """
    page = request.GET.get('page')

    # The user making the request
    user = request.user

    # The project that is viewed.
    project = Project.objects.filter(uid=uid).first()

    # Select all the data in the project.
    data_list = project.data_set.filter(deleted=False).order_by("-lastedit_date", "rank", "-date").all()
    data_paginator = Paginator(data_list, per_page=settings.PER_PAGE)
    data_list = data_paginator.get_page(page)

    recipe_list = project.analysis_set.filter(deleted=False).order_by("-rank", "-lastedit_date", "-date").all()

    # Annotate each recipe with the number of jobs it has.
    recipe_list = recipe_list.annotate(job_count=Count("job", filter=Q(job__deleted=False)))
    recipe_paginator = Paginator(recipe_list, per_page=settings.PER_PAGE)
    recipe_list = recipe_paginator.get_page(page)

    job_list = project.job_set.filter(deleted=False).order_by("-lastedit_date").all()

    # Filter job results by analysis
    filter_uid = request.GET.get('filter', '')
    recipe_filter = Analysis.objects.filter(uid=filter_uid).first()

    # The recipe filter exists
    if recipe_filter:
        job_list = job_list.filter(analysis=recipe_filter)

    # Add related content.
    job_list = job_list.select_related("analysis")
    job_paginator = Paginator(job_list, per_page=settings.PER_PAGE)
    job_list = job_paginator.get_page(page)

    # Who has write access
    write_access = auth.is_writable(user=user, project=project)

    # Build the context for the project.
    context = dict(project=project, data_list=data_list, recipe_list=recipe_list, job_list=job_list,
                   active=active, recipe_filter=recipe_filter, write_access=write_access, rerun_btn=True,
                   include_copy=False)

    # Compute counts for the project.
    counts = get_counts(project)

    # Update conext with the counts.
    context.update(counts)

    # Add any extra context that may come from parameters.
    context.update(extra_context)

    return render(request, template_name, context)
def project_view ( request , uid , template_name = "project_info.html" , active = 'info' , show_summary = None , extra_context = { } ) : page = request . GET . get ( 'page' ) # The user making the request user = request . user # The project that is viewed. project = Project . objects . filter ( uid = uid ) . first ( ) # Select all the data in the project. data_list = project . data_set . filter ( deleted = False ) . order_by ( "-lastedit_date" , "rank" , "-date" ) . all ( ) data_paginator = Paginator ( data_list , per_page = settings . PER_PAGE ) data_list = data_paginator . get_page ( page ) recipe_list = project . analysis_set . filter ( deleted = False ) . order_by ( "-rank" , "-lastedit_date" , "-date" ) . all ( ) # Annotate each recipe with the number of jobs it has. recipe_list = recipe_list . annotate ( job_count = Count ( "job" , filter = Q ( job__deleted = False ) ) ) recipe_paginator = Paginator ( recipe_list , per_page = settings . PER_PAGE ) recipe_list = recipe_paginator . get_page ( page ) job_list = project . job_set . filter ( deleted = False ) . order_by ( "-lastedit_date" ) . all ( ) # Filter job results by analysis filter_uid = request . GET . get ( 'filter' , '' ) recipe_filter = Analysis . objects . filter ( uid = filter_uid ) . first ( ) # The recipe filter exists if recipe_filter : job_list = job_list . filter ( analysis = recipe_filter ) # Add related content. job_list = job_list . select_related ( "analysis" ) job_paginator = Paginator ( job_list , per_page = settings . PER_PAGE ) job_list = job_paginator . get_page ( page ) # Who has write access write_access = auth . is_writable ( user = user , project = project ) # Build the context for the project. context = dict ( project = project , data_list = data_list , recipe_list = recipe_list , job_list = job_list , active = active , recipe_filter = recipe_filter , write_access = write_access , rerun_btn = True , include_copy = False ) # Compute counts for the project. counts = get_counts ( project ) # Update conext with the counts. context . update ( counts ) # Add any extra context that may come from parameters. context . update ( extra_context ) return render ( request , template_name , context )