[ckan-changes] [okfn/ckan] cea08c: [#382] Remove keys from extras when using convert_...

GitHub noreply at github.com
Fri Feb 22 19:38:23 UTC 2013

  Branch: refs/heads/382-convert_from_extras-remove-extras
  Home:   https://github.com/okfn/ckan
  Commit: cea08c4192095c3069440c49826628cf456a3ee4
  Author: amercader <amercadero at gmail.com>
  Date:   2013-02-22 (Fri, 22 Feb 2013)

  Changed paths:
    M ckan/logic/converters.py
    M ckan/tests/schema/test_schema.py

  Log Message:
  [#382] Remove keys from extras when using convert_from_extras

If fields are moved to the top level, they should be removed from
extras. See #376 for discussion. Added test.

Basically adapt the converter for transforming this:

 ('extras', 1, '__extras'): {u'package_id': u'9fbddea7-31bf-4bf2-9595-ae7b5d9c1102',
                       u'revision_id': u'a13e1cf5-6ecb-4ea4-a4c2-f5c0d865e401'},
 ('extras', 1, 'deleted'): <ckan.lib.navl.dictization_functions.Missing object at 0x3c4a050>,
 ('extras', 1, u'id'): u'871cbb3c-8c93-4afa-bf2a-8f2123a7b365',
 ('extras', 1, u'key'): u'frequency',
 ('extras', 1, u'revision_timestamp'): '2013-02-22T17:33:11.577374',
 ('extras', 1, u'state'): u'active',
 ('extras', 1, u'value'): u'DAILY',
to this:

 ('frequency',): u'DAILY'

More information about the ckan-changes mailing list