My string of elementary django questions continues.
If I ha开发者_运维问答ve three string variables and want to test that one of them, "fullname," is equivalent to two others concatenated, "first" and a space and then "last," how would I go about doing so in the context of a django template?
You could write a custom template tag, that might offer you something like this:
{% test_name_equality "Dagobert Duck" "Dagobert" "Duck" %}
in the template you can use very normal python string handling.
精彩评论