Ignore:
Timestamp:
10 Jul 2015, 11:33:03 (9 years ago)
Author:
Henrik Bettermann
Message:

Enable import of list-of-choices fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/batching.py

    r12883 r13159  
    6868        """Update obj to the values given in row.
    6969        """
    70         changed = []
    71         for key, value in row.items():
    72             # Skip fields to be ignored.
    73             if value == IGNORE_MARKER:
    74                 continue
    75             if not hasattr(obj, key):
    76                 continue
    77             try:
    78                 evalvalue = eval(value)
    79                 if isinstance(evalvalue, list):
    80                     value = evalvalue
    81             except:
    82                 pass
    83             setattr(obj, key, value)
    84             log_value = getattr(value, 'code', value)
    85             changed.append('%s=%s' % (key, log_value))
    86 
     70        items_changed = super(HostelProcessor, self).updateEntry(
     71            obj, row, site, filename)
    8772        # Log actions...
    8873        location_field = self.location_fields[0]
    89         items_changed = ', '.join(changed)
    9074        grok.getSite()['hostels'].logger.info(
    9175            '%s - %s - %s - updated: %s'
Note: See TracChangeset for help on using the changeset viewer.