@register.inclusion_tag('html_tags/callbacktags/count_callbaks.html')
def count_callbacks():
data = CallBacks.objects.filter(read=False).count()
return {'data': data }
{% if count_callbacks != 0 %}
Count = {% count_callbacks %}
{% endif %}
@register.assigment_tag
def count_callbacks():
data = CallBacks.objects.filter(read=False).count()
return {'data': data }
{% count_callbacks as cc%}
{% if cc.data != 0 %}
Count = {{ cc.data }}
{% endif %}
{% count_callbacks as cc %}
{% if cc.data != 0 %}
Count = {{ cc.data }}
{% endif %}