擅长:python、mysql、java
<p>如果我答对了您的问题,您需要编写自己的自定义<a href="https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters" rel="nofollow">django template filter</a>如下所示:</p>
<pre><code>from django.template.defaulttags import register
...
@register.filter
def getparam(dictionary, key):
return dictionary.get(key)
</code></pre>
<p>然后用这个在你的html中:</p>
<pre><code>{{ dato|getparam:propiedad }}
</code></pre>