🎉 Initialize module repository

This commit is contained in:
Marc Wempe
2026-04-03 23:08:58 +02:00
commit 685c3296f1
23 changed files with 4022 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"""Localized Scryfall image records for MTG cards."""
from odoo import fields, models
class MvdTcgMtgCardImage(models.Model):
"""Store one localized imported Scryfall image per card and language."""
_name = "mvd.tcg.mtg.card.image"
_description = "MTG Card Image"
_order = "card_id, language_code, id"
card_id = fields.Many2one(
"mvd.tcg.card",
required=True,
index=True,
ondelete="cascade",
)
language_code = fields.Char(required=True, index=True)
image_1920 = fields.Image(
required=True,
max_width=1920,
max_height=1920,
)
_card_language_unique = models.Constraint(
"UNIQUE (card_id, language_code)",
"Only one localized MTG image is allowed per card and language.",
)