Beispiel #1
0
def proposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a proposal need to be added.

    .. versionadded:: 0.1.5

    :arguments: space_url
    :context: form, get_place

    """
    get_place = get_object_or_404(Space, url=space_url)

    if (request.user.has_perm('admin_space', get_place) or
        request.user.has_perm('mod_space', get_place)):
        sel_form = ProposalSetSelectForm(request.POST or None)
        # We change here the queryset, so only the proposalsets of this space
        # appear on the list.
        sel_form.fields['proposalset'].queryset = ProposalSet.objects.filter(
            space=get_place)

        if request.method == 'POST':
            if sel_form.is_valid():
                pset = request.POST['proposalset']
                return HttpResponseRedirect(reverse(urln_prop.PROPOSAL_ADD_INSET,
                    kwargs={'space_url': space_url, 'set_id': pset}))

        return render_to_response("proposals/proposalset_select_form.html",
            {'form': sel_form, 'get_place': get_place},
            context_instance=RequestContext(request))
    else:
        raise PermissionDenied
Beispiel #2
0
def mergedproposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a merged proposal need to be added

    :arguments: space_url
    :context:form, get_place

    """
    get_place = get_object_or_404(Space, url=space_url)

    if (request.user.has_perm('admin_space', get_place) or
        request.user.has_perm('mod_space', get_place)):
        sel_form = ProposalSetSelectForm(request.POST or None)

        if request.method == 'POST':
            if sel_form.is_valid():
                pset = request.POST['proposalset']
                return HttpResponseRedirect(reverse(urln_prop.PROPOSAL_MERGED, kwargs={'space_url': space_url, 'set_id': pset}))

        return render_to_response("proposals/mergedproposal_in_set.html",
            {'form': sel_form, 'get_place': get_place},
            context_instance=RequestContext(request))
    else:
        raise PermissionDenied
def mergedproposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a merged proposal need to be added

    :arguments: space_url 
    :context:form, get_place

    """

    sel_form = ProposalSetSelectForm(request.POST or None)
    get_place = get_object_or_404(Space, url=space_url)

    if request.method == "POST":
        if sel_form.is_valid():
            pset = request.POST["proposalset"]
            return HttpResponseRedirect(
                reverse(urln_prop.PROPOSAL_MERGED, kwargs={"space_url": space_url, "set_id": pset})
            )

    return render_to_response(
        "proposals/mergedproposal_in_set.html",
        {"form": sel_form, "get_place": get_place},
        context_instance=RequestContext(request),
    )
Beispiel #4
0
def mergedproposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a merged proposal need to be added

    :arguments: space_url
    :context:form, get_place

    """
    get_place = get_object_or_404(Space, url=space_url)

    if (request.user.has_perm('admin_space', get_place) or
        request.user.has_perm('mod_space', get_place)):
        sel_form = ProposalSetSelectForm(request.POST or None)

        if request.method == 'POST':
            if sel_form.is_valid():
                pset = request.POST['proposalset']
                return HttpResponseRedirect(reverse(urln_prop.PROPOSAL_MERGED, kwargs={'space_url': space_url, 'set_id': pset}))

        return render_to_response("proposals/mergedproposal_in_set.html",
            {'form': sel_form, 'get_place': get_place},
            context_instance=RequestContext(request))
    else:
        raise PermissionDenied
Beispiel #5
0
def proposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a proposal need to be added.

    .. versionadded:: 0.1.5

    :arguments: space_url
    :context: form, get_place

    """
    get_place = get_object_or_404(Space, url=space_url)

    if (request.user.has_perm('admin_space', get_place) or
        request.user.has_perm('mod_space', get_place)):
        sel_form = ProposalSetSelectForm(request.POST or None)
        # We change here the queryset, so only the proposalsets of this space
        # appear on the list.
        sel_form.fields['proposalset'].queryset = ProposalSet.objects.filter(
            space=get_place)

        if request.method == 'POST':
            if sel_form.is_valid():
                pset = request.POST['proposalset']
                return HttpResponseRedirect(reverse(urln_prop.PROPOSAL_ADD_INSET,
                    kwargs={'space_url': space_url, 'set_id': pset}))

        return render_to_response("proposals/proposalset_select_form.html",
            {'form': sel_form, 'get_place': get_place},
            context_instance=RequestContext(request))
    else:
        raise PermissionDenied
def proposal_to_set(request, space_url):
    """
    Allows to select a proposal set to which a proposal need to be added.

    .. versionadded:: 0.1.5

    :arguments: space_url 
    :context: form, get_place

    """
    sel_form = ProposalSetSelectForm(request.POST or None)
    get_place = get_object_or_404(Space, url=space_url)

    if request.method == 'POST':
        if sel_form.is_valid():
            pset = request.POST['proposalset']
            return HttpResponseRedirect(
                reverse(urln_prop.PROPOSAL_ADD_INSET,
                        kwargs={
                            'space_url': space_url,
                            'set_id': pset
                        }))

    return render_to_response("proposals/proposalset_select_form.html", {
        'form': sel_form,
        'get_place': get_place
    },
                              context_instance=RequestContext(request))
Beispiel #7
0
def mergedproposal_to_set(request, space_url):

    """
    Allows to select a proposal set to which a merged proposal need to be added

    :arguments: space_url 
    :context:form, get_place

    """

    sel_form = ProposalSetSelectForm(request.POST or None)
    get_place = get_object_or_404(Space, url=space_url)

    if request.method == 'POST':
        if sel_form.is_valid():
            return redirect('/spaces/'+ space_url +'/proposal/merged/'+ request.POST['proposalset'] +'/')

    return render_to_response("proposals/mergedproposal_in_set.html",{'form':sel_form, 'get_place':get_place}, \
                                context_instance = RequestContext(request))
Beispiel #8
0
def mergedproposal_to_set(request, space_url):
    """
    Allows to select a proposal set to which a merged proposal need to be added

    :arguments: space_url 
    :context:form, get_place

    """

    sel_form = ProposalSetSelectForm(request.POST or None)
    get_place = get_object_or_404(Space, url=space_url)

    if request.method == 'POST':
        if sel_form.is_valid():
            return redirect('/spaces/' + space_url + '/proposal/merged/' +
                            request.POST['proposalset'] + '/')

    return render_to_response("proposals/mergedproposal_in_set.html",{'form':sel_form, 'get_place':get_place}, \
                                context_instance = RequestContext(request))
Beispiel #9
0
def proposal_to_set(request, space_url):
    
    """
    Allows to select a proposal set to which a proposal need to be added.

    .. versionadded:: 0.1.5

    :arguments: space_url 
    :context: form, get_place

    """
    sel_form = ProposalSetSelectForm(request.POST or None)
    get_place = get_object_or_404(Space, url=space_url)

    if request.method == 'POST':
        if sel_form.is_valid():
            pset = request.POST['proposalset']
            return HttpResponseRedirect(reverse(urln_prop.PROPOSAL_ADD_INSET,
                kwargs={'space_url':space_url, 'set_id':pset}))

    return render_to_response("proposals/proposalset_select_form.html",
        {'form':sel_form, 'get_place':get_place},
        context_instance = RequestContext(request))