Could we make an alias on an attribute in a django template? I think this is not work, but I tried {% loan.customer as customer %}
.
Thanks!
You probably want the with template tag.
{% with loan.customer as customer %}
<div>{{customer}}</div>
{% endwith %}
this is old style but still supported see the django documentation for new style and more info.
For now, New style
{% with customer=loan.customer %}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.