I presume that your messages are model instances. If so, create a queryset for the unread messages in your view, and pass that, or the result of applying .count() to it, as a template context variable, say "unread_message_count".
On Thu, Feb 12, 2015 at 1:06 PM, Ronaldo Bahia <rona...@jobconvo.com> wrote: > I am facing issues trying to get a count. Hope you can help me. > > In the template, if I insert {{ message.count }} not happens 'coz message > is a string. If I insert {% load inbox %} {% inbox_count as message %} it > returns all unread messages, but I need to get the unread messages sent by > a given user, in my case, a candidate to a job position. > > How can I do it? > Here is the thread: > > http://stackoverflow.com/questions/28484620/issue-in-django-count-string-in-a-template > > Thanx, > Ronaldo > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/c9a6fd12-9c3a-4ac0-a2ed-550c1bb56e21%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/c9a6fd12-9c3a-4ac0-a2ed-550c1bb56e21%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0sQ1pU64%3D1myhSLi10oBGQc-Hkw%2BjJrwmubwd6FmiZqsA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.