-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
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
Delay item class object creation #20
base: master
Are you sure you want to change the base?
Conversation
Reached a point where I think we need to make changes in ItemAdapter(self.item).get_field_meta(field_name) So that |
I was thinking a bit about it and it seems to be a good solution, even though it might not solve all the cases. It'll allow users to not set all fields as optional, but in case you build the item from multiple requests (or nested loaders), you'll still need to set these fields as optional. |
Codecov Report
@@ Coverage Diff @@
## master #20 +/- ##
===========================================
+ Coverage 99.60% 100.00% +0.39%
===========================================
Files 4 4
Lines 254 269 +15
===========================================
+ Hits 253 269 +16
+ Misses 1 0 -1
Continue to review full report at Codecov.
|
with this :class:`ItemLoader`. The nested loader shares the item | ||
with the parent :class:`ItemLoader` so calls to :meth:`add_xpath`, | ||
:meth:`add_value`, :meth:`replace_value`, etc. will behave as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure if this should go or stay; “shares the item” is not technically accurate any more, but maybe we should simply reword it so that it indicates that load_item()
returns the same object regardless of whether it is called on the original item loader or in a nested item loader.
Fixes #14