Subversion Repositories SmartDukaan

Rev

Rev 9451 | Rev 9454 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9451 Rev 9453
Line 119... Line 119...
119
    num_rows = sheet.nrows
119
    num_rows = sheet.nrows
120
    for rownum in range(1, num_rows):
120
    for rownum in range(1, num_rows):
121
        print sheet.row_values(rownum)
121
        print sheet.row_values(rownum)
122
        item_id = int(sheet.row_values(rownum)[0])
122
        item_id = int(sheet.row_values(rownum)[0])
123
        supc = sheet.row_values(rownum)[1]
123
        supc = sheet.row_values(rownum)[1]
-
 
124
        try:
124
        item = Item.query.filter_by(id=item_id).one()
125
            item = Item.query.filter_by(id=item_id).one()
-
 
126
        except Exception as e:
-
 
127
            print "No item found"
-
 
128
            print e
-
 
129
            one_line = _SnapdealItemInfo(item.id, '', '', 0, '', '','', '', 0, '', False,"item_related")
-
 
130
            all_supc.append(supc)
-
 
131
            all_lines.append(one_line)
-
 
132
            continue
-
 
133
            
125
        category = Category.query.filter_by(id=item.category).one()
134
        category = Category.query.filter_by(id=item.category).one()
126
        parent_category = Category.query.filter_by(parent_category_id=category.parent_category_id).first()
135
        parent_category = Category.query.filter_by(parent_category_id=category.parent_category_id).first()
127
        try:
136
        try:
128
            snapdeal_item = SnapdealItem.query.filter_by(item_id=item_id).one()
137
            snapdeal_item = SnapdealItem.query.filter_by(item_id=item_id).one()
129
            warehouse = iclient.getWarehouse(snapdeal_item.warehouseId)
138
            warehouse = iclient.getWarehouse(snapdeal_item.warehouseId)
Line 157... Line 166...
157
    
166
    
158
    i=1
167
    i=1
159
    for item in items:
168
    for item in items:
160
        sheet.write(i, 0, item.item_id)
169
        sheet.write(i, 0, item.item_id)
161
        if len(item.issue)!=0:
170
        if len(item.issue)!=0:
162
            sheet.write(i, 0, "Either Snapdeal item is not present on our end or wrong warehouse Id")
171
            sheet.write(i, 0, "Wrong item id or wrong warehouse Id")
163
        else:
172
        else:
164
            sheet.write(i, 1, "Unable to fetch info from snapdeal server")
173
            sheet.write(i, 1, "Unable to fetch info from snapdeal server")
165
        i+=1
174
        i+=1
166
    
175
    
167
    
176