Files
python-tdd/src/apps/applets/migrations/0003_seed_applets.py
Disco DeDisco 2b4f20c0e8
All checks were successful
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline was successful
collapse migrations: 41 epic + 20 lyric + 12 applets + others → fresh initials + 4 themed seeds
- Delete all incremental migration files across all apps; regenerate 0001_initial.py
  per app via makemigrations (schema unchanged, no model edits)
- applets/0003_seed_applets.py: all 20 Applet rows in one migration
- epic/0003_seed_fiorentine_deck.py: Fiorentine Minchiate DeckVariant + 78 cards
- epic/0004_seed_earthman_deck.py: Earthman DeckVariant + 50 major + 56 minor/middle
  arcana (106 cards); stray PENTACLES courts absent — clean from the start
- epic/0005_seed_astro_reference_tables.py: 12 signs, 10 planets, 9 aspect types
  (incl. Semisquare + Sesquiquadrate), 12 house labels
- 706 ITs green on fresh DB

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 21:06:23 -04:00

48 lines
2.2 KiB
Python

"""Seed all Applet rows."""
from django.db import migrations
APPLETS = [
# (slug, name, context, default_visible, grid_cols, grid_rows)
('wallet', 'Wallet', 'dashboard', True, 12, 3),
('new-post', 'New Post', 'billboard', True, 9, 3),
('my-posts', 'My Posts', 'billboard', True, 3, 3),
('username', 'Username', 'dashboard', True, 6, 3),
('palette', 'Palette', 'dashboard', True, 6, 3),
('new-game', 'New Game', 'gameboard', True, 4, 3),
('my-games', 'My Games', 'gameboard', True, 4, 4),
('game-kit', 'Game Kit', 'gameboard', True, 4, 3),
('wallet-balances', 'Wallet Balances', 'wallet', True, 3, 3),
('wallet-tokens', 'Wallet Tokens', 'wallet', True, 3, 3),
('wallet-payment', 'Payment Methods', 'wallet', True, 6, 3),
('billboard-my-scrolls', 'My Scrolls', 'billboard', True, 4, 3),
('billboard-my-contacts', 'Contacts', 'billboard', True, 4, 3),
('billboard-most-recent', 'Most Recent', 'billboard', True, 8, 6),
('gk-trinkets', 'Trinkets', 'game-kit', True, 3, 3),
('gk-tokens', 'Tokens', 'game-kit', True, 3, 3),
('gk-decks', 'Card Decks', 'game-kit', True, 3, 3),
('gk-dice', 'Dice Sets', 'game-kit', True, 3, 3),
('my-sky', 'My Sky', 'dashboard', True, 6, 6),
('billboard-notes', 'My Notes', 'billboard', True, 4, 4),
]
def seed(apps, schema_editor):
Applet = apps.get_model('applets', 'Applet')
for slug, name, context, default_visible, grid_cols, grid_rows in APPLETS:
Applet.objects.create(
slug=slug, name=name, context=context,
default_visible=default_visible,
grid_cols=grid_cols, grid_rows=grid_rows,
)
class Migration(migrations.Migration):
dependencies = [
('applets', '0002_initial'),
]
operations = [
migrations.RunPython(seed, migrations.RunPython.noop),
]