Skip to content

Commit

Permalink
models: set some default values
Browse files Browse the repository at this point in the history
  • Loading branch information
laggron42 committed Jan 15, 2025
1 parent 55cc537 commit 3d2c5ac
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions admin_panel/bd_models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ class Special(models.Model):
background = models.ImageField(
max_length=200, blank=True, null=True, help_text="1428x2000 PNG image"
)
tradeable = models.BooleanField(help_text="Whether balls of this event can be traded")
hidden = models.BooleanField(help_text="Hides the event from user commands")
tradeable = models.BooleanField(
help_text="Whether balls of this event can be traded", default=True
)
hidden = models.BooleanField(help_text="Hides the event from user commands", default=False)

def __str__(self) -> str:
return self.name
Expand Down Expand Up @@ -175,8 +177,12 @@ class Ball(models.Model):
capacity_description = models.CharField(
max_length=256, help_text="Description of the countryball's capacity"
)
capacity_logic = models.JSONField(help_text="Effect of this capacity", blank=True)
enabled = models.BooleanField(help_text="Enables spawning and show in completion")
capacity_logic = models.JSONField(
help_text="Effect of this capacity", blank=True, default=dict
)
enabled = models.BooleanField(
help_text="Enables spawning and show in completion", default=True
)
short_name = models.CharField(
max_length=12,
blank=True,
Expand All @@ -189,7 +195,9 @@ class Ball(models.Model):
null=True,
help_text="Additional possible names for catching this ball, separated by semicolons",
)
tradeable = models.BooleanField(help_text="Whether this ball can be traded with others")
tradeable = models.BooleanField(
help_text="Whether this ball can be traded with others", default=True
)
economy = models.ForeignKey(
Economy,
on_delete=models.SET_NULL,
Expand Down Expand Up @@ -244,7 +252,7 @@ class BallInstance(models.Model):
blank=True, null=True, help_text="Discord server ID where this ball was caught"
)
tradeable = models.BooleanField()
extra_data = models.JSONField(blank=True)
extra_data = models.JSONField(blank=True, default=dict)
locked = models.DateTimeField(
blank=True, null=True, help_text="If the instance was locked for a trade and when"
)
Expand Down

0 comments on commit 3d2c5ac

Please sign in to comment.