@task
def addon_total_contributions(*addons, **kw):
 log.info(('[%s@%s] Updating total contributions.' % (len(addons), addon_total_contributions.rate_limit)))
 stats = Contribution.objects.filter(addon__in=addons, uuid=None).values_list('addon').annotate(Sum('amount'))
 for (addon, total) in stats:
  Addon.objects.filter(id=addon).update(total_contributions=total)

@ task def addon_total_contributions ( * addons , ** kw ) : log . info ( ( '[%s@%s] Updating total contributions.' % ( len ( addons ) , addon_total_contributions . rate_limit ) ) ) stats = Contribution . objects . filter ( addon__in = addons , uuid = None ) . values_list ( 'addon' ) . annotate ( Sum ( 'amount' ) ) for ( addon , total ) in stats : Addon . objects . filter ( id = addon ) . update ( total_contributions = total )
updates the total contributions for a given addon .