views:

32

answers:

1
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_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. Can any 1 tell me what is wrong here. has_permissions has the value 1 or 0.

+2  A: 

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

Ignacio Vazquez-Abrams
{% ifequal %} worked for me thanks..
Hulk