本文整理汇总了Python中eums.services.contact_service.ContactService.get方法的典型用法代码示例。如果您正苦于以下问题:Python ContactService.get方法的具体用法?Python ContactService.get怎么用?Python ContactService.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eums.services.contact_service.ContactService
的用法示例。
在下文中一共展示了ContactService.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import get [as 别名]
def get(self, request, pk=None):
if pk:
return Response(status=HTTP_200_OK, data=ContactService.get(pk))
created_by_user_id = request.GET.get('createdbyuserid')
if created_by_user_id:
return Response(status=HTTP_200_OK, data=ContactService.get_by_user_id(created_by_user_id))
search_field = request.GET.get('searchfield')
if search_field:
return Response(status=HTTP_200_OK, data=ContactService.search(search_field))
return Response(status=HTTP_200_OK, data=ContactService.get_all())
示例2: test_should_search_contact_by_phone
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import get [as 别名]
def test_should_search_contact_by_phone(self):
requests.get = MagicMock(return_value=MagicMock(status_code=200, json=MagicMock(return_value=CONTACT)))
response = ContactService.get(CONTACT['phone'])
self.assertEqual(response, CONTACT)
示例3: build_contact
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import get [as 别名]
def build_contact(self):
logger.info('contact person id = %s' % self.contact_person_id)
return ContactService.get(self.contact_person_id)
示例4: get_object
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import get [as 别名]
def get_object(self, pk):
return ContactService.get(pk)
示例5: set_remote_contact_to_report_item
# 需要导入模块: from eums.services.contact_service import ContactService [as 别名]
# 或者: from eums.services.contact_service.ContactService import get [as 别名]
def set_remote_contact_to_report_item(report_item):
contact = ContactService.get(report_item.get('contactPersonId', report_item.get('contact_person_id')))
report_item['contactName'] = '%s %s' % (contact.get('firstName'), contact.get('lastName'))
report_item['contactPhone'] = contact.get('phone')
return report_item