def fleet_formatter_view(request): logger.debug("fleet_formatter_view called by user %s" % request.user) generated = "" if request.method == 'POST': form = FleetFormatterForm(request.POST) logger.debug("Received POST request containing form, valid: %s" % form.is_valid()) if form.is_valid(): generated = "Fleet Name: " + form.cleaned_data['fleet_name'] + "\n" generated = generated + "FC: " + form.cleaned_data['fleet_commander'] + "\n" generated = generated + "Comms: " + form.cleaned_data['fleet_comms'] + "\n" generated = generated + "Fleet Type: " + form.cleaned_data['fleet_type'] + " || " + form.cleaned_data[ 'ship_priorities'] + "\n" generated = generated + "Form Up: " + form.cleaned_data['formup_location'] + " @ " + form.cleaned_data[ 'formup_time'] + "\n" generated = generated + "Duration: " + form.cleaned_data['expected_duration'] + "\n" generated = generated + "Reimbursable: " + form.cleaned_data['reimbursable'] + "\n" generated = generated + "Important: " + form.cleaned_data['important'] + "\n" if form.cleaned_data['comments'] != "": generated = generated + "Why: " + form.cleaned_data['comments'] + "\n" logger.info("Formatted fleet broadcast for user %s" % request.user) else: form = FleetFormatterForm() logger.debug("Returning empty form to user %s" % request.user) context = {'form': form, 'generated': generated} return render_to_response('registered/fleetformattertool.html', context, context_instance=RequestContext(request))
def fleet_formatter_view(request): if request.method == 'POST': form = FleetFormatterForm(request.POST) if form.is_valid(): generated = "Fleet Name: " + form.cleaned_data['fleet_name'] + "\n" generated = generated + "FC: " + form.cleaned_data[ 'fleet_commander'] + "\n" generated = generated + "Comms: " + form.cleaned_data[ 'fleet_comms'] + "\n" generated = generated + "Fleet Type: " + form.cleaned_data[ 'fleet_type'] + " || " + form.cleaned_data[ 'ship_priorities'] + "\n" generated = generated + "Form Up: " + form.cleaned_data[ 'formup_location'] + " @ " + form.cleaned_data[ 'formup_time'] + "\n" generated = generated + "Duration: " + form.cleaned_data[ 'expected_duration'] + "\n" generated = generated + "Reimbursable: " + form.cleaned_data[ 'reimbursable'] + "\n" generated = generated + "Important: " + form.cleaned_data[ 'important'] + "\n" if form.cleaned_data['comments'] != "": generated = generated + "Why: " + form.cleaned_data[ 'comments'] + "\n" else: form = FleetFormatterForm() generated = "" context = {'form': form, 'generated': generated} return render_to_response('registered/fleetformattertool.html', context, context_instance=RequestContext(request))
def fleet_formatter_view(request): if request.method == 'POST': form = FleetFormatterForm(request.POST) if form.is_valid(): generated = "Fleet Name: " + form.cleaned_data['fleet_name'] + "\n" generated = generated + "FC: " + form.cleaned_data['fleet_commander'] + "\n" generated = generated + "Comms: " + form.cleaned_data['fleet_comms'] + "\n" generated = generated + "Fleet Type: " + form.cleaned_data['fleet_type'] + " || " + form.cleaned_data[ 'ship_priorities'] + "\n" generated = generated + "Form Up: " + form.cleaned_data['formup_location'] + " @ " + form.cleaned_data[ 'formup_time'] + "\n" generated = generated + "Duration: " + form.cleaned_data['expected_duration'] + "\n" generated = generated + "Reimbursable: " + form.cleaned_data['reimbursable'] + "\n" generated = generated + "Important: " + form.cleaned_data['important'] + "\n" if form.cleaned_data['comments'] != "": generated = generated + "Why: " + form.cleaned_data['comments'] + "\n" else: form = FleetFormatterForm() generated = "" context = {'form': form, 'generated': generated} return render_to_response('registered/fleetformattertool.html', context, context_instance=RequestContext(request))