Skip to content

Commit

Permalink
Preprocess values if item built from dict.
Browse files Browse the repository at this point in the history
  • Loading branch information
sortafreel authored and Júlio César Batista committed Apr 17, 2020
1 parent 4a9cba7 commit a3240c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrapy/loader/__init__.py
Expand Up @@ -35,8 +35,9 @@ def __init__(self, item=None, selector=None, response=None, parent=None, **conte
self.parent = parent
self._local_item = context['item'] = item
self._local_values = defaultdict(list)
# Preprocess values if item built from dict
for field_name, value in item.items():
self.add_value(field_name, value)
self._values[field_name] = self._process_input_value(field_name, value)

@property
def _values(self):
Expand Down

0 comments on commit a3240c7

Please sign in to comment.