Write your forwards methods here.

def forwards(self, orm):
        "Write your forwards methods here."

        projects = orm['samples.Project'].objects.exclude(name=DEFAULT_PROJECT_NAME)
        for project in projects:
            cohort = orm['samples.Cohort'](name=project.label, autocreated=True)
            cohort.project = project
            cohort.save()
            cohort_bulk_add(orm, cohort, orm['samples.Sample'].objects.filter(project=project).distinct())

        batches = orm['samples.Batch'].objects.select_related('project')
        for batch in batches:
            cohort = orm['samples.Cohort'](name=batch.label, autocreated=True)
            cohort.project = batch.project
            cohort.save()
            cohort_bulk_add(orm, cohort, orm['samples.Sample'].objects.filter(batch=batch).distinct())

        # Populate the default cohort with all samples
        default_cohort = orm['samples.Cohort'].objects.get(name=DEFAULT_COHORT_NAME)
        cohort_bulk_add(orm, default_cohort, orm['samples.Sample'].objects.all())