Fix friend_code max length issues in tests, and fix in_game_name length issues, also update tests to fit more scenarios

This commit is contained in:
badblocks 2025-03-27 17:26:07 -07:00
parent 0d4655bf80
commit b9c4d7a61d
10 changed files with 558 additions and 66 deletions

View file

@ -36,16 +36,18 @@ class Deck(models.Model):
class Card(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=128)
name = models.CharField(max_length=64)
decks = models.ManyToManyField("Deck")
cardset = models.CharField(max_length=8)
cardset = models.CharField(max_length=32)
cardnum = models.IntegerField()
style = models.CharField(max_length=255, null=False)
rarity_icon = models.CharField(max_length=8)
style = models.CharField(max_length=16)
rarity_icon = models.CharField(max_length=12)
rarity_level = models.IntegerField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
unique_together = ('cardset', 'cardnum')
def __str__(self):
# For display, we show the original rarity icons.
return f"{self.name} {self.rarity_icon} {self.cardset}"
return f"{self.name} ({self.cardset} #{self.cardnum})"