Skip to content
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

Merged
merged 6 commits into from
Sep 13, 2021

Conversation

DashaSyvyuk
Copy link

No description provided.

filter_param['externalId'] = external_id

if filters:
return self._get_resource_list(OrderSchema, filters=filter_param)
Copy link
Contributor

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)

return self._get_resource_list(OrderSchema)
filter_param['externalId'] = external_id

return self._get_resource_list(OrderSchema, filters=filter_param or None)
Copy link
Contributor

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.

Copy link
Contributor

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.

return self._get_resource_list(OrderSchema)
filter_param['externalId'] = external_id

return self._get_resource_list(OrderSchema, filters=filter_param or None)
Copy link
Contributor

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.


def diff(self, other):
differences = {}
fields = (
Copy link
Contributor

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.

@ndy40 ndy40 merged commit 0e29338 into master Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants