Ejemplo n.º 1
0
def add_view(request, page_app):
    org = Organization.mine(request)
    if org is None:
        return HttpResponseForbidden('Opération interdite')
    form = CallForm(request.POST or None)
    if form.is_valid():
        call = form.save(commit=False)
        call.organization = org
        call.save()
        return HttpResponseRedirect('/mon-compte/p/mes-appels-doffres/')
    return render_view('page_calls/edit.html',
                       {'object': page_app, 'form': form},
                       MEDIAS,
                       context_instance=RequestContext(request))
Ejemplo n.º 2
0
def offer_add_view(request, page_app):
    org = Organization.mine(request)
    if org is None:
        return HttpResponseForbidden('Opération interdite')
    form = OfferForm(request.POST or None)
    if form.is_valid():
        offer = form.save(commit=False)
        offer.provider = org
        offer.save()
        form.save_m2m()
        return HttpResponseRedirect('/mon-compte/p/mes-offres/')
    return render_view('page_directory/offer_edit.html',
                       {'object': page_app, 'form': form, 'org': org, 'propose': 'propose' in request.GET},
                       OFFER_MEDIA,
                       context_instance=RequestContext(request))
Ejemplo n.º 3
0
def add_view(request, page_app):
    org = Organization.mine(request)
    if org is None:
        return HttpResponseForbidden('Opération interdite')
    form = CallForm(request.POST or None)
    if form.is_valid():
        call = form.save(commit=False)
        call.organization = org
        call.save()
        return HttpResponseRedirect('/mon-compte/p/mes-appels-doffres/')
    return render_view('page_calls/edit.html', {
        'object': page_app,
        'form': form
    },
                       MEDIAS,
                       context_instance=RequestContext(request))
Ejemplo n.º 4
0
def offer_add_view(request, page_app):
    org = Organization.mine(request)
    if org is None:
        return HttpResponseForbidden('Opération interdite')
    form = OfferForm(request.POST or None)
    if form.is_valid():
        offer = form.save(commit=False)
        offer.provider = org
        offer.save()
        form.save_m2m()
        return HttpResponseRedirect('/mon-compte/p/mes-offres/')
    return render_view('page_directory/offer_edit.html', {
        'object': page_app,
        'form': form,
        'org': org,
        'propose': 'propose' in request.GET
    },
                       OFFER_MEDIA,
                       context_instance=RequestContext(request))
Ejemplo n.º 5
0
def my_organization(request):
    return {"my_organization": Organization.mine(request)}
Ejemplo n.º 6
0
def my_organization(request):
    return {'my_organization': Organization.mine(request)}