Exemplo n.º 1
0
Arquivo: views.py Projeto: eedeep/efo
def organisation(request, organisation_id=None, slug=None):
    
    organisation = get_object_or_404(
        Organisation, 
        slug=slug, 
        is_published=True)
    
    projects = Project.objects.filter(
        projectcompany__organisation=organisation,
        is_published=True).distinct()
        
    articles = Article.objects.filter(
        project__in=projects, 
        is_published=True).distinct()
        
    location = u'%s %s' % (organisation.street, organisation.city)
        
    view.send(organisation)
    
    return render_to_response(
        'organisations/organisation.html',
        {
            "articles": articles,
            "location": location.split(),
            "organisation": organisation,
            "projects": projects,
        },
        context_instance=RequestContext(request))
Exemplo n.º 2
0
def programme(request, slug=None):
    programme = get_object_or_404(
        Programme,
        slug=slug.rstrip('/'))

    view.send(programme)

    return render_to_response(
        'programmes/programme.html',
        {
            "programme": programme,
        },
        context_instance=RequestContext(request))
Exemplo n.º 3
0
Arquivo: views.py Projeto: eedeep/efo
def programme(
    request,
    programme_id=None,
    slug=None,
):

    programme = get_object_or_404(Programme, slug=slug)

    view.send(programme)

    return render_to_response('projects/project.html', {
        "programme": programme,
    },
                              context_instance=RequestContext(request))
Exemplo n.º 4
0
def project(request, project_id=None, slug=None,):
    
    project = get_object_or_404(
        Project,
        slug=slug)
        
    view.send(project)

    return render_to_response(
        'projects/project.html',
        {
            "project": project,
        },
        context_instance=RequestContext(request))
Exemplo n.º 5
0
def project(
    request,
    project_id=None,
    slug=None,
):

    project = get_object_or_404(Project, is_published=True, slug=slug)

    view.send(project)

    return render_to_response('projects/project.html', {
        "project": project,
    },
                              context_instance=RequestContext(request))
Exemplo n.º 6
0
def event(request, event_id=None, slug=None,):
    
    event = get_object_or_404(Event, slug=slug, is_published=True)
    
    location = u'%s %s' % (event.street, event.city)
    
    # import ipdb; ipdb.set_trace()
    
    view.send(event)
    
    return render_to_response(
        'events/event.html',
        {
            "event": event,
            "location": location.split(),
        },
        context_instance=RequestContext(request))
Exemplo n.º 7
0
def article(request, article_id=None, slug=None, country_code=None):

    try:
        article = Article.objects.select_related().get(slug=slug,
                                                       is_published=True)
    except ObjectDoesNotExist:
        raise Http404

    contributor_articles = Article.objects.select_related().filter(
        users__in=article.users.iterator, is_published=True).distinct()

    # tracking views with popularity
    view.send(article)

    return render_to_response('articles/article.html', {
        "article": article,
        "contributor_articles": contributor_articles
    },
                              context_instance=RequestContext(request))
Exemplo n.º 8
0
Arquivo: views.py Projeto: eedeep/efo
def article(request, article_id=None, slug=None, country_code=None):
    
    try:
        article = Article.objects.select_related().get(slug=slug, is_published=True)
    except ObjectDoesNotExist:
        raise Http404
    
    contributor_articles = Article.objects.select_related().filter(
        users__in=article.users.iterator,
        is_published=True).distinct()
    
    # tracking views with popularity
    view.send(article)
    
    return render_to_response(
        'articles/article.html',
        {
            "article": article,
            "contributor_articles": contributor_articles
        },
        context_instance=RequestContext(request))
Exemplo n.º 9
0
Arquivo: views.py Projeto: eedeep/efo
def organisation(request, organisation_id=None, slug=None):

    organisation = get_object_or_404(Organisation,
                                     slug=slug,
                                     is_published=True)

    projects = Project.objects.filter(
        projectcompany__organisation=organisation,
        is_published=True).distinct()

    articles = Article.objects.filter(project__in=projects,
                                      is_published=True).distinct()

    location = u'%s %s' % (organisation.street, organisation.city)

    view.send(organisation)

    return render_to_response('organisations/organisation.html', {
        "articles": articles,
        "location": location.split(),
        "organisation": organisation,
        "projects": projects,
    },
                              context_instance=RequestContext(request))