-
Notifications
You must be signed in to change notification settings - Fork 3
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
CTD-130 add search by order number to order model #36
CTD-130 add search by order number to order model #36
Conversation
livestyled/resource_client.py
Outdated
filter_param['externalId'] = external_id | ||
|
||
if filters: | ||
return self._get_resource_list(OrderSchema, filters=filter_param) |
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 think these 4 lines could be simplified to:
return self._get_resource_list(OrderSchema, filters=filter_param or None)
livestyled/resource_client.py
Outdated
return self._get_resource_list(OrderSchema) | ||
filter_param['externalId'] = external_id | ||
|
||
return self._get_resource_list(OrderSchema, filters=filter_param or None) |
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.
why are we passing saying filter_param or None
? I think if empty, this should still work.
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.
better approach. Build your values to contain this object.
- start with an empty params = {}
params = {
'external_id': external_id,
'filters': filter_param
}
self._get_resource_list(OrderSchema, **params)
the method self._get_resource_list(..)
has an external_id and filters params parameter, we should still use it.
livestyled/resource_client.py
Outdated
return self._get_resource_list(OrderSchema) | ||
filter_param['externalId'] = external_id | ||
|
||
return self._get_resource_list(OrderSchema, filters=filter_param or None) |
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.
better approach. Build your values to contain this object.
- start with an empty params = {}
params = {
'external_id': external_id,
'filters': filter_param
}
self._get_resource_list(OrderSchema, **params)
the method self._get_resource_list(..)
has an external_id and filters params parameter, we should still use it.
livestyled/models/order.py
Outdated
|
||
def diff(self, other): | ||
differences = {} | ||
fields = ( |
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.
can fit in one line. What of the other properties. We should just solve this problem at once so we don't have to come back to add it later.
No description provided.