'Write your forwards methods here.'

def _forwards(self, orm):

    for release in RangeQuerySetWrapperWithProgressBar(orm.Release.objects.exclude(new_groups=0)):
        projects = list(release.projects.values_list('id', flat=True))
        if (len(projects) > 1):
            for p_id in projects:
                new_groups = orm.Group.objects.filter(first_release=release, project_id=p_id).count()
                if (not new_groups):
                    continue
                orm.ReleaseProject.objects.filter(release_id=release.id, project_id=p_id).update(new_groups=new_groups)
        elif (len(projects) == 1):
            orm.ReleaseProject.objects.filter(release_id=release.id, project_id=projects[0]).update(new_groups=release.new_groups)
