首先,在B工程中的urls.py为被调用的view取一个名字:
- === modified file 'dashboard_app/urls.py'
- --- dashboard_app/urls.py 2012-06-13 10:46:00 +0000
- +++ dashboard_app/urls.py 2012-06-19 08:57:07 +0000
- @@ -35,7 +35,8 @@
- url(r'^reports/(?P[a-zA-Z0-9-_]+)/$', 'report_detail'),
- url(r'^tests/$', 'test_list'),
- url(r'^tests/(?P[^/]+)/$', 'test_detail'),
- - url(r'^notification/$', 'notification_pref'),
- + url(r'^notification/$', 'notification_pref',
- + name='dashboard_app.views.notification'),
- url(r'^xml-rpc/$', linaro_django_xmlrpc.views.handler,
- name='dashboard_app.views.dashboard_xml_rpc_handler',
- kwargs={
在A工程中调用这个view的名字:
- === modified file 'lava_server/templates/me.html'
- --- lava_server/templates/me.html 2011-11-22 16:58:50 +0000
- +++ lava_server/templates/me.html 2012-06-19 08:42:45 +0000
- @@ -9,6 +9,8 @@
- >{% trans "Sign out" %}</a></li>
- <li><a href="{% url django.contrib.auth.views.password_change %}"
- >{% trans "Change your password" %}</a></li>
- + <li><a href="{% url dashboard_app.views.notification %}"
- + >{% trans "Notification Type Definition" %}</a></li>
- </ul>
- {% endblock %}
即可在me页面转到那个view,前提是两个工程已经集成在了一起。
阅读(3790) | 评论(0) | 转发(0) |