@register.simple_tag
def dictionary_count(lang, project):
 return Dictionary.objects.filter(project=project, language=lang).count()

@ register . simple_tag def dictionary_count ( lang , project ) : return Dictionary . objects . filter ( project = project , language = lang ) . count ( )
returns number of words in dictionary .