Highrise的Pythonic封装。
项目描述
highrise
=============
python-highrise是封装Highrise API的一种Python方式。
安装
-----------
easy_install ElementTree https://github.com/chriscohoat/highrise/tarball/master
使用
-----
# 导入highrise封装器。
from highrise.wrapper import Highrise
# 准备Highrise与API令牌和人员ID的交互
highrise_api_token = 'TOKEN_HERE'
person_highrise_id = 'PERSON_ID_HERE'
hr = Highrise('https://examplecorporation.highrisehq.com',highrise_api_token)
# 获取笔记列表或电子邮件列表
notes = hr.notes(person_highrise_id)
emails = hr.emails(person_highrise_id)
与笔记交互(使用Django)
-----
views.py
def highrise_interaction(request)
# 准备Highrise与API令牌和人员ID的交互
highrise_api_token = 'TOKEN_HERE'
person_highrise_id = 'PERSON_ID_HERE'
hr = Highrise('https://examplecorporation.highrisehq.com',highrise_api_token)
# 获取笔记列表或电子邮件列表
notes = hr.notes(person_highrise_id)
return render_to_response('template.html',{'notes':notes}, context_instance=RequestContext(request))
template.html
{% extends "base.html" %}
{% block content %}
{% if not notes %}
<h3>此人员没有可用的笔记。</h3>
{% else %}
{% for note in notes %}
<h3>关于 {{ note.subject_name }} 的笔记</h3>
<h4>添加于 {{ note.created_at }}</h4>
<p>
{{ note.body }}
<br />
<br />
<a href="https://examplecorporation.highrisehq.com/notes/{{ note.note_id }}" target="blank">阅读更多...</a>
</p>
{% endfor %}
{% endif %}
{% endblock %}
测试
-------
测试内容即将推出。
=============
python-highrise是封装Highrise API的一种Python方式。
安装
-----------
easy_install ElementTree https://github.com/chriscohoat/highrise/tarball/master
使用
-----
# 导入highrise封装器。
from highrise.wrapper import Highrise
# 准备Highrise与API令牌和人员ID的交互
highrise_api_token = 'TOKEN_HERE'
person_highrise_id = 'PERSON_ID_HERE'
hr = Highrise('https://examplecorporation.highrisehq.com',highrise_api_token)
# 获取笔记列表或电子邮件列表
notes = hr.notes(person_highrise_id)
emails = hr.emails(person_highrise_id)
与笔记交互(使用Django)
-----
views.py
def highrise_interaction(request)
# 准备Highrise与API令牌和人员ID的交互
highrise_api_token = 'TOKEN_HERE'
person_highrise_id = 'PERSON_ID_HERE'
hr = Highrise('https://examplecorporation.highrisehq.com',highrise_api_token)
# 获取笔记列表或电子邮件列表
notes = hr.notes(person_highrise_id)
return render_to_response('template.html',{'notes':notes}, context_instance=RequestContext(request))
template.html
{% extends "base.html" %}
{% block content %}
{% if not notes %}
<h3>此人员没有可用的笔记。</h3>
{% else %}
{% for note in notes %}
<h3>关于 {{ note.subject_name }} 的笔记</h3>
<h4>添加于 {{ note.created_at }}</h4>
<p>
{{ note.body }}
<br />
<br />
<a href="https://examplecorporation.highrisehq.com/notes/{{ note.note_id }}" target="blank">阅读更多...</a>
</p>
{% endfor %}
{% endif %}
{% endblock %}
测试
-------
测试内容即将推出。