- TarotCard.cautions JSONField + cautions_json property; migrations 0027–0029 seed The Schizo (number=1) with 4 rival-interaction cautions (Roman-numeral card refs: I. The Pervert / II. The Occultist, etc.) - Sig-select overlay: FLIP (stat-block toggle) + FYI (caution tooltip) buttons; nav PRV/NXT portaled outside tooltip at bottom corners (z-70); caution tooltip covers stat block (inset:0, z-60, Gaussian blur); tooltip click dismisses; FLIP/FYI fully dead while btn-disabled; nav wraps circularly (4/4 → 1/4, 1/4 → 4/4) - SCSS: btn-disabled specificity fix (!important); btn-nav-left/right classes; sig-caution-* layout; stat-face keyword lists - Jasmine suite expanded: stat block + FLIP (5 specs), caution tooltip (16 specs) including wrap-around and disabled-button behaviour - IT tests: TarotCardCautionsTest (5), SigSelectRenderingTest (8) - Role-card SVG icons added to static/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.4 KiB
Python
66 lines
2.4 KiB
Python
"""
|
|
Schema + data migration:
|
|
1. Add `cautions` JSONField (list, default=[]) to TarotCard.
|
|
2. Seed The Schizo (Earthman MAJOR #1) with 4 rival-interaction cautions.
|
|
All other cards default to [] — the UI shows a placeholder when empty.
|
|
"""
|
|
from django.db import migrations, models
|
|
|
|
SCHIZO_CAUTIONS = [
|
|
'This card will reverse into <span class="card-ref">The Pervert</span> when it'
|
|
' comes under dominion of <span class="card-ref">The Occultist</span>, which in turn'
|
|
' reverses into <span class="card-ref">Pestilence</span>.',
|
|
|
|
'This card will reverse into <span class="card-ref">The Paranoiac</span> when it'
|
|
' comes under dominion of <span class="card-ref">The Despot</span>, which in turn'
|
|
' reverses into <span class="card-ref">War</span>.',
|
|
|
|
'This card will reverse into <span class="card-ref">The Neurotic</span> when it'
|
|
' comes under dominion of <span class="card-ref">The Capitalist</span>, which in turn'
|
|
' reverses into <span class="card-ref">Famine</span>.',
|
|
|
|
'This card will reverse into <span class="card-ref">The Suicidal</span> when it'
|
|
' comes under dominion of <span class="card-ref">The Fascist</span>, which in turn'
|
|
' reverses into <span class="card-ref">Death</span>.',
|
|
]
|
|
|
|
|
|
def seed_schizo_cautions(apps, schema_editor):
|
|
TarotCard = apps.get_model("epic", "TarotCard")
|
|
DeckVariant = apps.get_model("epic", "DeckVariant")
|
|
try:
|
|
earthman = DeckVariant.objects.get(slug="earthman")
|
|
except DeckVariant.DoesNotExist:
|
|
return
|
|
TarotCard.objects.filter(
|
|
deck_variant=earthman, arcana="MAJOR", number=1
|
|
).update(cautions=SCHIZO_CAUTIONS)
|
|
|
|
|
|
def clear_schizo_cautions(apps, schema_editor):
|
|
TarotCard = apps.get_model("epic", "TarotCard")
|
|
DeckVariant = apps.get_model("epic", "DeckVariant")
|
|
try:
|
|
earthman = DeckVariant.objects.get(slug="earthman")
|
|
except DeckVariant.DoesNotExist:
|
|
return
|
|
TarotCard.objects.filter(
|
|
deck_variant=earthman, arcana="MAJOR", number=1
|
|
).update(cautions=[])
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("epic", "0026_earthman_suit_renames_and_keywords"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name="tarotcard",
|
|
name="cautions",
|
|
field=models.JSONField(default=list),
|
|
),
|
|
migrations.RunPython(seed_schizo_cautions, reverse_code=clear_schizo_cautions),
|
|
]
|