- sig-select.js: three-way reversal branch — major (qualifier + concept name), non-major w. reversal (suit qualifier word on own line + card title), non-major fallback (polarity qualifier only) - template: .fan-card-face-upright + .fan-card-face-reversal wrapper divs for compact centred text groups; arcana label sits between them - _card-deck.scss: wrapper divs display:flex; padding-top on reversal group equalises gap to MIDDLE ARCANA label on both sides; removes margin:auto overcorrect - migration 0007: populates reversal qualifier word per suit on Earthman Middle Arcana court cards (Seething/Gloomy/Nervous/Vacant); clears The Schizo's incorrectly inherited Territoriality reversal Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
74 lines
2.2 KiB
Python
74 lines
2.2 KiB
Python
"""Populate TarotCard.reversal for Earthman Middle Arcana court cards.
|
|
|
|
Each suit has a fixed reversal qualifier that replaces the polarity qualifier
|
|
(Elevated/Graven) when the card is spun to its reversed face:
|
|
Brands → Seething Grails → Gloomy Blades → Nervous Crowns → Vacant
|
|
|
|
Also clears the incorrectly inherited reversal on The Schizo (card 1), which
|
|
mistakenly carried 'Territoriality' from The Occultist (card 2).
|
|
"""
|
|
from django.db import migrations
|
|
|
|
SUIT_REVERSAL_QUALIFIER = {
|
|
"BRANDS": "Seething",
|
|
"GRAILS": "Gloomy",
|
|
"BLADES": "Nervous",
|
|
"CROWNS": "Vacant",
|
|
}
|
|
|
|
RANK_NAMES = {11: "Maid", 12: "Jack", 13: "Queen", 14: "King"}
|
|
|
|
|
|
def populate_reversals(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
|
|
|
|
# Middle Arcana court cards
|
|
for suit, qualifier in SUIT_REVERSAL_QUALIFIER.items():
|
|
TarotCard.objects.filter(
|
|
deck_variant=earthman,
|
|
arcana="MIDDLE",
|
|
suit=suit,
|
|
number__in=list(RANK_NAMES.keys()),
|
|
).update(reversal=qualifier)
|
|
|
|
# Clear The Schizo's incorrectly inherited reversal (belongs to The Occultist)
|
|
TarotCard.objects.filter(
|
|
deck_variant=earthman,
|
|
arcana="MAJOR",
|
|
number=1,
|
|
).update(reversal="")
|
|
|
|
|
|
def clear_reversals(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="MIDDLE",
|
|
suit__in=list(SUIT_REVERSAL_QUALIFIER.keys()),
|
|
number__in=list(RANK_NAMES.keys()),
|
|
).update(reversal="")
|
|
TarotCard.objects.filter(deck_variant=earthman, arcana="MAJOR", number=1).update(
|
|
reversal="Territoriality"
|
|
)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("epic", "0006_add_deck_variant_to_tableseat"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(populate_reversals, reverse_code=clear_reversals),
|
|
]
|