Skip to content

Commit

Permalink
Solution-py-game-models v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfoxwork committed Nov 3, 2024
1 parent 8e678b2 commit 9191281
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@


class Race(models.Model):
name = models.CharField(max_length=255, unique=True)
RACE_TYPE = (
("Elf", "elf race"),
("Dwarf", "dwarf race"),
("Human", "human race"),
("Ork", "ork race")
)
name = models.CharField(max_length=255, unique=True, choices=RACE_TYPE)
description = models.TextField(blank=True)


Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_db(players: dict) -> None:
else:
guild = None

Player.objects.create(
Player.objects.get_or_create(
nickname=player,
email=email_info,
bio=bio_info,
Expand Down

0 comments on commit 9191281

Please sign in to comment.