Пример #1
0
def addItemsToMap(request, template_name="uploadFile.html"):
    action = 'addItemsToMap'
    print "in add item to map modal"
    if request.method == 'POST':
        form = UploadFileForm(request.POST, request.FILES)
        if form.is_valid():
            try:
                addPieces(request.FILES['file'], True)
                return HttpResponseRedirect('/success/')
            except Exception, e:
                return HttpResponseRedirect('/error/')
Пример #2
0
    # store pid
    path = os.path.abspath(os.path.dirname(__file__))
    f = open( path + "/pids", 'a')
    f.write(str(os.getpid()) + '\n')
    # log("Started with pid:" + str(os.getpid()))
    f.close()

    if(sys.argv[1] == "importRegions"):
        from LOG import insertRegions
        insertRegions.insertIntoDb("../teamwait/LOG/regionData.csv")
    if sys.argv[1] == "testv2":
      import testfile
      testfile.test_methods(sys.argv[2])
    elif(sys.argv[1] == "importRegionsAndMaps"):
        from LOG import insertRegions
        from MAP import addMapAcc
        insertRegions.insertIntoDb("../teamwait/LOG/regionData.csv")
        addMapAcc.insertIntoDb("../teamwait/MAP/MapAccounts.csv", False)
    elif(sys.argv[1] == "importInvAndSales"):
        from INV import addInventory
        addInventory.addPieces("../teamwait/INV/SampleGlassesInv.csv", False)
    elif(sys.argv[1] == "updateInvForAMap"):
        from INV import updateInventory
        updateInventory.updatePieces("../teamwait/INV/MapAccWithRegNos.csv", False, sys.argv[2])
    elif(sys.argv[1] == "deleteMap"):
        from MAP import deleteMapAcc
        deleteMapAcc.deleteAccount(sys.argv[2])
    else:
      execute_from_command_line(sys.argv)