示例#1
0
def import_kml(request):
    # Handle file upload
    if request.method == 'POST':
        kml = Kml(file=request.FILES['file'], visibility=False)
        kml.save()

        # Redirect to the document list after POST
        return HttpResponseRedirect('/VYD/KmlManager/kmls')
    else:
        form = UploadKMLForm()  # A empty, unbound form

    # Render list page with the documents and the form
    return render_to_response(
        'import_kml.html',
        {'form': form},
    )
示例#2
0
    def form(self):

        return UploadKMLForm(self.request.form)
示例#3
0
 def upload_kml_form(self):
     return UploadKMLForm()