

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(('%s %s' % (self.name, i)))
            i += 1
        used.add((l.user, slug))
        l.slug = slug
        orm.save()

dataset/ETHPy150Open crate-archive/crate-site/crateweb/apps/lists/migrations/0003_migrate_name_to_slug.py Migration.forwards/VarMisuse@118/130 `l`->`orm`