-
Notifications
You must be signed in to change notification settings - Fork 3
add getting contact by field #10
add getting contact by field #10
Conversation
Tests failing because pep8 is failing on things that this PR didn't touch. Looking into it... |
Seems a newer version of pep8 that checks for more things. Updated locally and it showed the same pep8 errors. pep8 errors are now fixed. |
Ready for a first review. |
go_http/contacts.py
Outdated
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 wondering whether we shouldn't overload .get_contact()
and do something like .get_contact(*args, **kw)
and then:
if not kw and len(args) == 1:
return self._contact_by_key(args[0])
elif len(kw) == 1 and not args:
field, value = kw.items()[0]
return self._contact_by_field(field, value)
raise ValueError(".contact() may either be called as .get_contact(contact_key) or .get_contact(field=value)")
Thoughts?
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.
That seems good, I'll implement that.
Left one suggestion and some minor comments. Looks good though. |
@hodgestar Changes implemented. Ready for another review. |
👍 |
…tact-by-field add getting contact by field
The functionality for getting a contact by a field (eg. MSISDN) is now implemented in the contacts API, we should now implement this functionality in the client.