开发者

Django templates tag error

def _table_(request,id,has_permissions):
    dict = {}
    dict.update(get_newdata(request,rid))
    return  render_to_response('home/_display.html',context_instance=RequestContext(request,{'dict': dict, 'rid' : rid, 'has_permissions' : str(has_开发者_JAVA技巧permissions)}))

In templates the code is as,

{% if has_permissions == "1" %}
<input type="button" value="Edit" id="edit" onclick="javascript:edit('{{id}}')"  style="display:inline;"/>&nbsp;&nbsp;&nbsp;&nbsp;
{% endif %}

There is a template error in has_permissions line. What is wrong here? has_permissions has the value 1 or 0.


Versions of Django before 1.2 do not support relational operators in {% if %}. Use {% ifequal %} or a bare {% if %} instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜