Changeset 6847
- Timestamp:
- 3 Oct 2011, 08:04:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py
r6835 r6847 176 176 """ 177 177 for key, value in row.items(): 178 # Skip location and catalog fields used to locate the object178 # Skip fields not declared in interface. 179 179 if hasattr(obj, key): 180 180 setattr(obj, key, value) … … 218 218 return 219 219 220 def checkConversion(self, row, mode='ignore'): 221 """Validates all values in row. 222 """ 223 converter = IObjectConverter(self.iface) 224 errs, inv_errs, conv_dict = converter.fromStringDict( 225 row, self.factory_name) 226 return errs, inv_errs, conv_dict 227 220 228 def doImport(self, path, headerfields, mode='create', user='Unknown', 221 229 logger=None): … … 247 255 num_warns = 0 248 256 site = grok.getSite() 249 converter = IObjectConverter(self.iface)257 250 258 for raw_row in reader: 251 259 num += 1 252 260 string_row = self.applyMapping(raw_row, mapping) 253 261 row = dict(string_row.items()) # create deep copy 254 errs, inv_errs, conv_dict = converter.fromStringDict( 255 string_row, self.factory_name) 262 errs, inv_errs, conv_dict = self.checkConversion(string_row, mode) 256 263 if errs or inv_errs: 257 264 num_warns += 1
Note: See TracChangeset for help on using the changeset viewer.