Beispiel #1
0
def upload_backup(request):
    if request.method == 'POST':
        form = UploadBackupForm(request.POST, request.FILES)
        if form.is_valid():
            backup.handle_backup(request.FILES['file'])
            return redirect_and_flash_success(request,
                    "Backup {} uploaded successfully".format(request.FILES['file'].name))
    else:
        form = UploadBackupForm()
    return render(request, 'common/data_entry.html',
                              {'form': form, 'title': 'Upload a Backup'})
Beispiel #2
0
def upload_backup(request):
    if request.method == "POST":
        form = UploadBackupForm(request.POST, request.FILES)
        if form.is_valid():
            backup.handle_backup(request.FILES["file"])
            return redirect_and_flash_success(
                request, "Backup {} uploaded successfully".format(
                    request.FILES["file"].name))
    else:
        form = UploadBackupForm()
    return render(request, "common/data_entry.html", {
        "form": form,
        "title": "Upload a Backup"
    })
def upload_backup(request):
    if request.method == 'POST':
        form = UploadBackupForm(request.POST, request.FILES)
        if form.is_valid():
            backup.handle_backup(request.FILES['file'])
            return render_to_response('thanks.html', 
                                     {'data_type': "Backup",
                                      'data_name': request.FILES['file'].name,
                                      'data_modification': "CREATE"}, 
                                      context_instance=RequestContext(request))
    else:
        form = UploadBackupForm()
    return render_to_response('data_entry.html', 
                              {'form': form,
                               'title': 'Upload a Backup'}, 
                               context_instance=RequestContext(request))
Beispiel #4
0
def upload_backup(request):
    if request.method == 'POST':
        form = UploadBackupForm(request.POST, request.FILES)
        if form.is_valid():
            backup.handle_backup(request.FILES['file'])
            return render_to_response('thanks.html', 
                                     {'data_type': "Backup",
                                      'data_name': request.FILES['file'].name,
                                      'data_modification': "CREATE"}, 
                                      context_instance=RequestContext(request))
    else:
        form = UploadBackupForm()
    return render_to_response('data_entry.html', 
                              {'form': form,
                               'title': 'Upload a Backup'}, 
                               context_instance=RequestContext(request))