Perhaps try using string placeholders - from the django documentation :
The lines you pass in _ () or ugettext () can take place as specified using the standard default interpolation syntax called Python. Example:
def my_view(request, m, d):
output = _('Today is %(month)s %(day)s.') % {'month': m, 'day': d}
return HttpResponse(output)
Applying this to your example, you get:
task = _('You have %(num_friends)s friends') % {'num_friends': c1.task}
source
share