Пример #1
0
def get_organizations(uuids):
    try:
        return [
            organization
            for organization in Organization.filter(uuid__in=uuids).all()
        ]
    except Exception:
        return []
Пример #2
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))
Пример #3
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))
Пример #4
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))
Пример #5
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))
Пример #6
0
def my_organization(request):
    return {"my_organization": Organization.mine(request)}
Пример #7
0
def my_organization(request):
    return {'my_organization': Organization.mine(request)}