from django.db import migrations def seed_game_kit_applets(apps, schema_editor): Applet = apps.get_model('applets', 'Applet') for slug, name in [ ('gk-trinkets', 'Trinkets'), ('gk-tokens', 'Tokens'), ('gk-decks', 'Card Decks'), ('gk-dice', 'Dice Sets'), ]: Applet.objects.get_or_create( slug=slug, defaults={'name': name, 'grid_cols': 3, 'grid_rows': 3, 'context': 'game-kit'}, ) class Migration(migrations.Migration): dependencies = [ ('applets', '0007_fix_billboard_applets'), ] operations = [ migrations.RunPython(seed_game_kit_applets, migrations.RunPython.noop) ]