当前位置: 首页>>代码示例>>Python>>正文


Python ContactService.get方法代码示例

本文整理汇总了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())
开发者ID:unicefuganda,项目名称:eums,代码行数:15,代码来源:contact_endpoint.py

示例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)
开发者ID:unicefuganda,项目名称:eums,代码行数:7,代码来源:test_contact_service.py

示例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)
开发者ID:unicefuganda,项目名称:eums,代码行数:5,代码来源:runnable.py

示例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)
开发者ID:unicefuganda,项目名称:eums,代码行数:4,代码来源:contact_endpoint.py

示例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
开发者ID:unicefuganda,项目名称:eums,代码行数:7,代码来源:csv_export_service.py


注:本文中的eums.services.contact_service.ContactService.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。