Changeset 8215


Ignore:
Timestamp:
19 Apr 2012, 13:04:24 (13 years ago)
Author:
uli
Message:

More docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py

    r8214 r8215  
    258258           is a dict with the values from input dict converted.
    259259
     260        If mode is ``'create'`` or ``'update'`` then some additional
     261        filtering applies:
     262
     263        - values set to DELETION_MARKER are set to missing_value (or
     264          default value if field is required) and
     265
     266        - values set to IGNORE_MARKER are ignored and thus not part of
     267          the returned ``<DATA_DICT>``.
     268
    260269        If errors happen, i.e. the error lists are not empty, always
    261270        an empty ``<DATA_DICT>`` is returned.
     
    275284                schema_field = field.interface[field.__name__]
    276285                field_converter = IFieldConverter(schema_field)
    277                 if mode == 'update':
    278                     if val == DELETION_MARKER:
     286                if mode in ('update', 'create'):
     287                    if val == IGNORE_MARKER:
     288                        continue
     289                    elif val == DELETION_MARKER:
    279290                        val = schema_field.missing_value
    280291                        if schema_field.required:
    281292                            val = schema_field.default
    282293                        new_data[key] = val
    283                         continue
    284                     if val == IGNORE_MARKER:
    285294                        continue
    286295                request.form.update(
Note: See TracChangeset for help on using the changeset viewer.