def project(request, portuuid, projectid):
    try:
        portfolio = portmodel.portFolio.objects.get(uuid=portuuid,
                                                    deleted=False,
                                                    public=True)

        if portfolio == None:
            raise Http404

    except Exception as ObjectDoesNotExist:
        raise Http404

    project = projectmodel.project.objects.select_related('user').get(
        pk=projectid, deleted=False)
    services = project.services.split(',')
    profile = Userprofile.Userprofile()
    try:
        profile = Userprofile.Userprofile.objects.get(user__id=project.user.id)
    except Exception as ObjectDoesNotExist:
        profile = Userprofile.Userprofile()

    return render(request, 'public/viewproject.html', {
        'project': project,
        'userprofile': profile,
        'services': services
    })
Exemple #2
0
def view(request, portuuid):
    portfolio = portmodel.portFolio.objects.get(user__id=request.user.id,
                                                uuid=portuuid,
                                                deleted=False)
    relprojects = portmodel.relProjectPortfolio.objects.filter(
        portfolio__id=portfolio.id, deleted=False)
    projects = []
    for project in relprojects:
        projects.append(
            projectmodel.project.objects.get(pk=project.project.id))

    profile = accountmodel.Userprofile()
    try:
        profile = accountmodel.Userprofile.objects.get(
            user__id=portfolio.user.id)
    except Exception as ObjectDoesNotExist:
        profile = accountmodel.Userprofile()

    return render(
        request, 'portfolio/view.html', {
            'request': request,
            'projects': projects,
            'portfolio': portfolio,
            'profile': profile
        })
Exemple #3
0
def view(request, projectid):
    project = projectmodel.project.objects.get(pk = projectid, user__id = request.user.id)
    services = project.services.split(',')

    profile = accountmoel.Userprofile()
    try:
        profile = accountmoel.Userprofile.objects.get(user__id=project.user.id)
    except Exception as ObjectDoesNotExist:
        profile = accountmoel.Userprofile()

    return render(request, 'public/viewproject.html', {'request':request,'project': project,'services':services,'userprofile':profile });
def portfolio(request, portuuid):

    try:
        portfolio = portmodel.portFolio.objects.get(uuid=portuuid, deleted=False, public=True)
        relprojects = portmodel.relProjectPortfolio.objects.filter(portfolio__id=portfolio.id, deleted=False)
        projects = []
        for project in relprojects:
            projects.append(projectmodel.project.objects.get(pk=project.project.id))

        if request.user.id != portfolio.user.id:
            hit_count = HitCount.objects.get_for_object(portfolio)
            hit_count_response = HitCountMixin.hit_count(request, hit_count)

        profile = Userprofile.Userprofile()
        try:
            profile = Userprofile.Userprofile.objects.get(user__id=portfolio.user.id)
        except Exception as ObjectDoesNotExist:
            profile = Userprofile.Userprofile()

        return render_to_response('public/viewportfolio.html', RequestContext(request, {'request':request,'projects': projects,
                                                                                        'portfolio': portfolio,'profile':profile}));

    except Exception as ObjectDoesNotExist:
        raise Http404