def _active_contributors_id(from_date, to_date, locale, product):
 editors = Revision.objects.filter(created__gte=from_date).values_list('creator', flat=True).distinct()
 reviewers = Revision.objects.filter(reviewed__gte=from_date).values_list('reviewer', flat=True).distinct()
 if to_date:
  editors = editors.filter(created__lt=to_date)
  reviewers = reviewers.filter(reviewed__lt=to_date)
 if locale:
  editors = editors.filter(document__locale=locale)
  reviewers = reviewers.filter(document__locale=locale)
 if product:
  editors = editors.filter((Q(document__products=product) | Q(document__parent__products=product)))
  reviewers = reviewers.filter((Q(document__products=product) | Q(document__parent__products=product)))
 return set((list(editors) + list(reviewers)))

def _active_contributors_id ( from_date , to_date , locale , product ) : editors = Revision . objects . filter ( created__gte = from_date ) . values_list ( 'creator' , flat = True ) . distinct ( ) reviewers = Revision . objects . filter ( reviewed__gte = from_date ) . values_list ( 'reviewer' , flat = True ) . distinct ( ) if to_date : editors = editors . filter ( created__lt = to_date ) reviewers = reviewers . filter ( reviewed__lt = to_date ) if locale : editors = editors . filter ( document__locale = locale ) reviewers = reviewers . filter ( document__locale = locale ) if product : editors = editors . filter ( ( Q ( document__products = product ) | Q ( document__parent__products = product ) ) ) reviewers = reviewers . filter ( ( Q ( document__products = product ) | Q ( document__parent__products = product ) ) ) return set ( ( list ( editors ) + list ( reviewers ) ) )
return the set of ids for the top contributors based on the params .