(request, domain, app_id, module_id, form_id)
This view is meant to be a run as a one-off script to support a specific
    app that Jeremy is writing. Running this script subsequent times on the
    same form will not have adverse affects.
    :param request:
    :param domain:
    :param app_id:
    :param module_id:
    :param form_id:
    :return:
This view is meant to be a run as a one-off script to support a specific
    app that Jeremy is writing. Running this script subsequent times on the
    same form will not have adverse affects.
    :param request:
    :param domain:
    :param app_id:
    :param module_id:
    :param form_id:
    :return:
This view is meant to be a run as a one - off script to support a specific app that Jeremy is writing . Running this script subsequent times on the same form will not have adverse affects . : param request : : param domain : : param app_id : : param module_id : : param form_id : : return :
def task_creation(request, domain, app_id, module_id, form_id):
    '''
    This view is meant to be a run as a one-off script to support a specific
    app that Jeremy is writing. Running this script subsequent times on the
    same form will not have adverse affects.
    :param request:
    :param domain:
    :param app_id:
    :param module_id:
    :param form_id:
    :return:
    '''
    if request.method == 'POST':

        html_form = TaskCreationForm(request.POST)
        if html_form.is_valid():

            questions = html_form.cleaned_data['question_ids'].split()
            form = get_app(domain, app_id).modules[int(module_id)].forms[int(form_id)]
            # Make changes to the form
            message = _ucla_form_modifier(form, questions)
            return HttpResponse(message, content_type="text/plain")

        return HttpResponse("Soemthing was wrong with the form you submitted. Your CommCare form is unchanged.", content_type="text/plain")

    elif request.method == 'GET':
        html_form = TaskCreationForm()
        response = HttpResponse()
        response.write('<form action="'+reverse('ucla_task_creation', args=(domain, app_id, module_id, form_id))+'" method="post">')
        response.write(html_form.as_p())
        response.write('<p><input type="submit" value="Process Form"></p>')
        response.write("</form>")
        return response
    else:
        return HttpResponse("GET or POST only.", content_type="text/plain")
def task_creation ( request , domain , app_id , module_id , form_id ) : if request . method == 'POST' : html_form = TaskCreationForm ( request . POST ) if html_form . is_valid ( ) : questions = html_form . cleaned_data [ 'question_ids' ] . split ( ) form = get_app ( domain , app_id ) . modules [ int ( module_id ) ] . forms [ int ( form_id ) ] # Make changes to the form message = _ucla_form_modifier ( form , questions ) return HttpResponse ( message , content_type = "text/plain" ) return HttpResponse ( "Soemthing was wrong with the form you submitted. Your CommCare form is unchanged." , content_type = "text/plain" ) elif request . method == 'GET' : html_form = TaskCreationForm ( ) response = HttpResponse ( ) response . write ( '<form action="' + reverse ( 'ucla_task_creation' , args = ( domain , app_id , module_id , form_id ) ) + '" method="post">' ) response . write ( html_form . as_p ( ) ) response . write ( '<p><input type="submit" value="Process Form"></p>' ) response . write ( "</form>" ) return response else : return HttpResponse ( "GET or POST only." , content_type = "text/plain" )