我有一个Customer
类,它有一个representative
字段....此字段最初是空白的,但是当用户打开所选客户的详细信息页面时,他们将被授予代表此客户的开放通过点击链接。我想到的模板布局是这样的:更新单个字段
<strong>Representative: </strong>
{% if customer.representative %}
{{ customer.representative }}
{% else %}
<a href="{% url representCustomer customer.id %}">Represent this customer.</a>
{% endif %}
所剩下的就是影响这个的视图...这就是我卡住的地方。
Ahhhh ......谢谢德米特里。这工作像一个魅力...我也会记住小费。 – Stephen 2010-03-21 11:48:51