def generate_counts(component, start_date, end_date):
 result = {}
 for translation in component.translation_set.all():
  authors = Change.objects.content().filter(translation=translation, timestamp__range=(start_date, end_date)).values_list(u'author__email', u'author__first_name', u'unit__num_words')
  for (email, name, words) in authors:
   if (words is None):
    continue
   if (email not in result):
    result[email] = {u'name': name, u'email': email, u'words': words, u'count': 1}
   else:
    result[email][u'words'] += words
    result[email][u'count'] += 1
 return list(result.values())

def generate_counts ( component , start_date , end_date ) : result = { } for translation in component . translation_set . all ( ) : authors = Change . objects . content ( ) . filter ( translation = translation , timestamp__range = ( start_date , end_date ) ) . values_list ( u'author__email' , u'author__first_name' , u'unit__num_words' ) for ( email , name , words ) in authors : if ( words is None ) : continue if ( email not in result ) : result [ email ] = { u'name' : name , u'email' : email , u'words' : words , u'count' : 1 } else : result [ email ] [ u'words' ] += words result [ email ] [ u'count' ] += 1 return list ( result . values ( ) )
generates credits data for given component .