Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- raw = {}
- for item in array.values():
- raw.update({
- item.get('attributeId') : {
- 'id' : item.get('attributeId'),
- 'title' : item.get('title'),
- 'code' : item.get('code'),
- 'showInSpecList' : item.get('showInSpecList'),
- 'description' : item.get('description'),
- 'attributeGroupId' : item.get('attributeGroupId'),
- 'cssClass' : item.get('cssClass'),
- 'attributeValues': {
- 'id' : item.get('id'),
- 'value' : item.get('value'),
- 'title' : item.get('valueTitle'),
- 'cssClass': item.get('valueCssClass')
- }
- }
- })
- mapper = AttributesMapper()
- result = {}
- print(type(raw)) # - <class 'dict'>
- for item in raw.items():
- print(type(item)) # - <class 'tuple'>
- result.update(mapper.createObject(item))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement