We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample code
import scrapy from itemloaders import ItemLoader from itemloaders.processors import Identity class TestItem1(scrapy.Item): list_of_test_items = scrapy.Field() class TestItem2(scrapy.Item): count = scrapy.Field() price = scrapy.Field() class TestItemLoader(ItemLoader): default_item_class = TestItem1 list_of_test_items_in = Identity() list_of_test_items_out = Identity() il = TestItemLoader() il.add_value('list_of_test_items', TestItem2(count=1, price=50)) print(il.load_item())
Expected output
{'list_of_test_items': [{'count': 1, 'price': 50}]}
Actual output
{'list_of_test_items': ['count', 'price']}
This is because the _BaseItem is removed from _ITERABLE_SINGLE_VALUES https://github.com/scrapy/itemloaders/blob/master/itemloaders/utils.py#L9
_BaseItem
_ITERABLE_SINGLE_VALUES
In scrapy _BaseItem is included in _ITERABLE_SINGLE_VALUES https://github.com/scrapy/scrapy/blob/2.2/scrapy/utils/misc.py#L20
The text was updated successfully, but these errors were encountered:
Gallaecio
Successfully merging a pull request may close this issue.
Sample code
Expected output
{'list_of_test_items': [{'count': 1, 'price': 50}]}
Actual output
{'list_of_test_items': ['count', 'price']}
This is because the
_BaseItem
is removed from_ITERABLE_SINGLE_VALUES
https://github.com/scrapy/itemloaders/blob/master/itemloaders/utils.py#L9In scrapy
_BaseItem
is included in_ITERABLE_SINGLE_VALUES
https://github.com/scrapy/scrapy/blob/2.2/scrapy/utils/misc.py#L20The text was updated successfully, but these errors were encountered: