def get_organizations(uuids): try: return [ organization for organization in Organization.filter(uuid__in=uuids).all() ] except Exception: return []
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))
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))
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))
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))
def my_organization(request): return {"my_organization": Organization.mine(request)}
def my_organization(request): return {'my_organization': Organization.mine(request)}