RWS deck: flip has_card_images=True to light up image-mode rendering — TDD
The 79 resized + pngquant'd RWS card-face PNGs at cards-faces/english/rider-waite-smith/ are now in place (commit 1e1a0a5). This data migration sets the `tarot-rider-waite-smith` DeckVariant's `has_card_images` flag to True so the existing image-mode branches across all 6 card+stat-block surfaces (sprint A.0-A.8 of [[project-image-based-deck-face-rendering]]) light up for RWS the same way they already do for Minchiate:
- card face becomes the .png; rank + suit + name + qualifier + arcana all migrate to the adjacent stat block
- deck-stack icon (_deck_stack_icon.html) uses the RWS card-back PNG instead of the SCSS placeholder rect-fill
- monodeck collapse still applies (is_polarized stays False, set by 0012); my_sea picker renders a single deck stack instead of dual gravity/levity halves
Inverts the IT `test_rws_has_card_images_false` → `test_rws_has_card_images_true`. 1475 ITs green; full epic suite (480) green.
No template change needed — the {% if deck.has_card_images %} branches were shipped in sprints A.3-A.7.5 for Minchiate and are deck-agnostic.
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
35
src/apps/epic/migrations/0014_rws_has_card_images_true.py
Normal file
35
src/apps/epic/migrations/0014_rws_has_card_images_true.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Flip RWS `has_card_images` to True now that the 79 RWS card-face PNGs are
|
||||
installed + resized + pngquant'd at `cards-faces/english/rider-waite-smith/`.
|
||||
Light up the existing image-mode rendering branches (already shipped for
|
||||
Minchiate) for the RWS deck too — the card face becomes the image; the text
|
||||
metadata moves to the adjacent stat block; the deck-stack icon uses the
|
||||
RWS card-back PNG instead of the generic SCSS placeholder rect-fill.
|
||||
|
||||
`is_polarized` stays False (set by 0012). RWS was always a monodeck — flip-to-
|
||||
back FLIP renders the card-back image instead of cycling gravity/levity halves.
|
||||
|
||||
The is_default flag stays False (Earthman remains the default-equipped deck for
|
||||
new users); explicit equip via Game Kit is required to put RWS on the table.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def forward(apps, schema_editor):
|
||||
DeckVariant = apps.get_model("epic", "DeckVariant")
|
||||
DeckVariant.objects.filter(slug="tarot-rider-waite-smith").update(
|
||||
has_card_images=True,
|
||||
)
|
||||
|
||||
|
||||
def backward(apps, schema_editor):
|
||||
DeckVariant = apps.get_model("epic", "DeckVariant")
|
||||
DeckVariant.objects.filter(slug="tarot-rider-waite-smith").update(
|
||||
has_card_images=False,
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("epic", "0013_seed_minchiate_fiorentine_1860_1890"),
|
||||
]
|
||||
operations = [migrations.RunPython(forward, backward)]
|
||||
@@ -996,9 +996,12 @@ class DeckSchemaA0Test(TestCase):
|
||||
rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith")
|
||||
self.assertEqual(rws.family, "english")
|
||||
|
||||
def test_rws_has_card_images_false(self):
|
||||
def test_rws_has_card_images_true(self):
|
||||
"""Flipped 2026-05-28 by 0014 — the 79 resized + pngquant'd RWS
|
||||
face PNGs are installed at `cards-faces/english/rider-waite-smith/`,
|
||||
so the RWS variant joins Minchiate in image-rendering mode."""
|
||||
rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith")
|
||||
self.assertFalse(rws.has_card_images)
|
||||
self.assertTrue(rws.has_card_images)
|
||||
|
||||
def test_rws_is_polarized_false(self):
|
||||
rws = DeckVariant.objects.get(slug="tarot-rider-waite-smith")
|
||||
|
||||
Reference in New Issue
Block a user