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 game-models #439

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

Conversation

MarkShapka
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.

main.py Outdated
Comment on lines 51 to 52
print(new_player)
print("---------------")

Choose a reason for hiding this comment

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

Delete these prints, they are not needed.

main.py Outdated
name=guild_name,
description=guild.get("description")
)
guild_from_db = Guild.objects.get(name=guild_name)

Choose a reason for hiding this comment

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

There is no need to query the database additionally in case you create a record, .create() will return the required object. You need to write it to a variable. Execute .get() in the else statement to achieve that.

main.py Outdated
Comment on lines 31 to 36
if not Race.objects.filter(name=race_name).exists():
Race.objects.create(
name=race_name,
description=race_.get("description")
)
race_from_db = Race.objects.get(name=race_name)

Choose a reason for hiding this comment

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

There is no need to query the database additionally in case you create a record, .create() will return the required object. You need to write it to a variable. Execute .get() in the else statement to achieve that.

Copy link

@Polyakiv-Andrey Polyakiv-Andrey left a comment

Choose a reason for hiding this comment

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

Good job!

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.

3 participants