Ejemplo n.º 1
0
def importFromXLS6():
    import xlrd
    customList = xlrd.open_workbook("ALL STOCKIEST.xlsx")
    worksheet = customList.sheet_by_name("MARG ERP 9+ Excel Report")

    for i in range(5, 58):
        customer = worksheet.cell(i, 1).value
        city = worksheet.cell(i, 2).value
        customerObject = Customer()
        customerObject.cName = customer
        customerObject.city = city
        customerObject.save()
Ejemplo n.º 2
0
def importFromXLS4():
    import xlrd
    customList = xlrd.open_workbook("ALL PARTY DETAILS.xlsx")
    worksheet = customList.sheet_by_name("Sheet1")

    for i in range(2, 50):
        customer = worksheet.cell(i, 0).value
        city = worksheet.cell(i, 3).value
        address = worksheet.cell(i, 10).value
        customerObject = Customer()
        customerObject.cName = customer
        customerObject.address = address
        customerObject.city = city
        customerObject.save()
Ejemplo n.º 3
0
def importFromXLS():
    import xlrd
    customList = xlrd.open_workbook("list.xls")
    worksheet = customList.sheet_by_name("Sheet1")

    for i in range(9, 3582):
        if worksheet.cell(i, 9).value != "":
            city = worksheet.cell(i, 9).value
        if worksheet.cell(i, 7).value != "":
            uniqueCode = worksheet.cell(i, 3).value
            customer = worksheet.cell(i, 7).value
            address = worksheet.cell(i, 14).value
            customerObject = Customer()
            customerObject.cName = customer
            customerObject.address = address
            customerObject.city = city
            customerObject.usn = uniqueCode
            customerObject.save()
Ejemplo n.º 4
0
def importFromXLS1():
    import xlrd
    customList = xlrd.open_workbook("VVM STOCKIEST LIST.XLS")
    worksheet = customList.sheet_by_name("Sheet1")

    for i in range(5, 707, 6):
        code = worksheet.cell(i, 1).value
        customer = worksheet.cell(i, 3).value

        address1 = worksheet.cell(i + 1, 3).value
        address2 = worksheet.cell(i + 2, 3).value
        address3 = worksheet.cell(i + 3, 3).value
        city = worksheet.cell(i + 4, 3).value
        customerObject = Customer()
        customerObject.cName = customer
        customerObject.address = address1 + " " + address2 + " " + address3
        customerObject.city = city
        customerObject.usn = code
        customerObject.save()