Changeset 12812 for main/waeup.ikoba
- Timestamp:
- 23 Mar 2015, 11:32:12 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_customer_data.csv
r12537 r12812 3 3 Y777777,Claus,Finau,2,1990-01-03,bb@aa.ng,1234,m,requested 4 4 ,Susann,Berson,3,1990-01-04,cc@aa.ng,1234,F,requested 5 ,,,,,,,, 6 ,, ,,, ,,, 7 ,,,<IGNORE>,, ,,, 5 8 ,Else,Mueller,4,1990-01-05,dd@aa.ng,1234,f,approved 6 9 X888888,Alfons,Meier,5,1990-01-02,ee@aa.ng,1234,m,requested -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r12633 r12812 259 259 self.assertEqual(num_warns,0) 260 260 self.assertEqual(len(self.app['customers']), 10) 261 # Three empty rows have been skipped. 262 self.assertEqual(num, 12) 261 263 self.assertEqual(self.app['customers']['X666666'].reg_number,'1') 262 264 self.assertEqual( -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/batching.py
r12334 r12812 274 274 return errs, inv_errs, conv_dict 275 275 276 def emptyRow(self, row): 277 """Detect empty rows. 278 """ 279 for value in row.values(): 280 if value.strip() and not value in (None, IGNORE_MARKER): 281 return False 282 return True 283 276 284 def doImport(self, path, headerfields, mode='create', user='Unknown', 277 285 logger=None, ignore_empty=True): … … 308 316 for raw_row in reader: 309 317 num += 1 318 # Skip row if empty 319 if self.emptyRow(raw_row): 320 continue 310 321 string_row = self.applyMapping(raw_row, mapping) 311 322 if ignore_empty and mode in ('update',):
Note: See TracChangeset for help on using the changeset viewer.