Update single field

Posted by 47 on Stack Overflow See other posts from Stack Overflow or by 47
Published on 2010-03-21T10:27:12Z Indexed on 2010/03/21 10:31 UTC
Read the original article Hit count: 147

Filed under:

I have a Customer class which has a representative field....this field is initially blank but when the user opens up the details page of the chosen customer, they'll be given the open of representing this customer by clicking on a link. The template layout I was thinking of is this:

<strong>Representative: </strong>
{% if customer.representative %}
   {{ customer.representative }}
{% else %}
   <a href="{% url representCustomer customer.id %}">Represent this customer.</a>
{% endif %}

All that remains is the view to effect this...this is where I'm stuck.

© Stack Overflow or respective owner

Related posts about django