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())
def execute_one_time_sync(): contacts = ContactService.get_all() for contact in contacts: ContactService.add_or_update_rapid_pro_contact(contact)