Skip to content

code doctor test#55

Open
cb109 wants to merge 390 commits into
initial_commitfrom
develop
Open

code doctor test#55
cb109 wants to merge 390 commits into
initial_commitfrom
develop

Conversation

@cb109

@cb109 cb109 commented Jan 8, 2022

Copy link
Copy Markdown
Owner

No description provided.

cb109 added 30 commits June 23, 2018 16:08

@code-review-doctor code-review-doctor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Worth considering. View full project report here.



class PurchaseWeight(TimestampMixin, models.Model):
purchase = models.ForeignKey("purchases.Purchase", on_delete=models.CASCADE)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Django automatically creates a related_name if it's not set. If it were set then a more readable and explicit relationship is set up. More details.


class PurchaseWeight(TimestampMixin, models.Model):
purchase = models.ForeignKey("purchases.Purchase", on_delete=models.CASCADE)
member = models.ForeignKey("auth.User", on_delete=models.CASCADE)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Again, with an explicit related_name would be better.

@code-review-doctor code-review-doctor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

user_id = obj["user__id"]
filepath = os.path.join(
output_dir,
"{0}{1}".format(user_id, ext),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

f-string is easier to read, write, and less computationally expensive than legacy string formatting. Read more.

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