Example #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()
Example #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()
Example #3
0
 def save(self, user):
     try:	
         data = user.get_profile()
     except:
         data = Customer(user=user)
         
     print 'Inside save method of UserRegForm'
     
     data.first_name = self.cleaned_data["first_name"]
     data.last_name = self.cleaned_data["last_name"]
     data.address = self.cleaned_data["address"]
     data.city = self.cleaned_data["city"]
     data.zip = self.cleaned_data["zip"]
     data.date_of_birth = self.cleaned_data["date_of_birth"]
     data.save()
Example #4
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()
Example #5
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()