Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #993

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Solution #993

wants to merge 9 commits into from

Conversation

CheshireKate
Copy link

No description provided.

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several changes were requested. Make sure that all tests pass

db/models.py Outdated


class Race(models.Model):
PLAYER_CHOICES = (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, define choices correctly and use them in case of definition

players = json.load(file)
for player_name, player_data in players.items():
race_data = player_data["race"]
race, created = Race.objects.get_or_create(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could omit the second returned argument since it is not used

Suggested change
race, created = Race.objects.get_or_create(
race, _ = Race.objects.get_or_create(

db/models.py Outdated
Comment on lines 5 to 10
PLAYER_CHOICES = (
("Elf", "Elf"),
("Dwarf", "Dwarf"),
("Human", "Human"),
("Ork", "Ork"),
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If PLAYER_CHOICES is not used in the code and only takes up space, you can remove it.

@@ -0,0 +1,24 @@
# Generated by Django 4.0.2 on 2024-10-16 15:49

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good practice to include one migration per app per PR in Django projects since it helps to avoid migrations folder overload in the future. Represent all changes done to models in one migration file per app per PR, please

class Skill(models.Model):
name = models.CharField(max_length=255, unique=True)
bonus = models.TextField(max_length=255)
race = models.ForeignKey(Race, on_delete=models.CASCADE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add related name for relational fields

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not resolved

Copy link

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Failed!

Please fix it!

Copy link

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Failed!

Please fix it!

@@ -0,0 +1,19 @@
# Generated by Django 4.0.2 on 2024-10-18 14:59

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good practice to include one migration per app per PR in Django projects since it helps to avoid migrations folder overload in the future. Represent all changes done to models in one migration file per app per PR, please

class Skill(models.Model):
name = models.CharField(max_length=255, unique=True)
bonus = models.TextField(max_length=255)
race = models.ForeignKey(Race, on_delete=models.CASCADE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants