You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
518 B

  1. # Generated by Django 3.2.6 on 2021-09-07 09:19
  2. from django.db import migrations
  3. from django.utils.text import slugify
  4. def fill_slug(apps, schema_editor):
  5. Check = apps.get_model("api", "CHeck")
  6. for c in Check.objects.exclude(name="").only("name"):
  7. Check.objects.filter(id=c.id).update(slug=slugify(c.name))
  8. class Migration(migrations.Migration):
  9. dependencies = [
  10. ("api", "0079_auto_20210907_0918"),
  11. ]
  12. operations = [migrations.RunPython(fill_slug, migrations.RunPython.noop)]