def forwards(self, orm):
        used = set()
        for l in orm["lists.List"].objects.filter(Q(slug=None) | Q(slug="")):
            slug = slugify(l.name)
            i = 1

            while (l.user, slug) in used:
                slug = slugify(u"%s %s" % (self.name, i))
                i += 1

            used.add((l.user, slug))

            l.slug = slug
            l.save()
dataset/ETHPy150Open crate-archive/crate-site/crateweb/apps/lists/migrations/0003_migrate_name_to_slug.py/Migration.forwards/original