'Attach all the activity to the versions.'

@classmethod
def transformer_activity(cls, versions):

    from mkt.developers.models import VersionLog
    ids = set((v.id for v in versions))
    if (not versions):
        return
    al = VersionLog.objects.filter(version__in=ids).order_by('created').select_related('activity_log', 'version')
    def rollup(xs):
        groups = sorted_groupby(xs, 'version_id')
        return dict(((k, list(vs)) for (k, vs) in groups))
    al_dict = rollup(al)
    for version in versions:
        v_id = version.id
        version.all_activity = al_dict.get(v_id, [])
