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

my_commit #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

my_commit #19

wants to merge 1 commit into from

Conversation

sakshi-2412
Copy link
Member

CSoC Task 2 Submission

I have completed the following tasks

  • Stage 1
  • Stage 2
  • Stage 3
  • Stage 4

Copy link
Member

@m-e-l-u-h-a-n m-e-l-u-h-a-n left a comment

Choose a reason for hiding this comment

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

Great work on the task @sakshi-2412 . Your submission has been evaluated.

Comment on lines +139 to +140
avgRating = BookRating.objects.filter(book__pk=book_id).aggregate(Avg('rating'))['rating__avg']
avgRating = round(float(avgRating),2)
Copy link
Member

Choose a reason for hiding this comment

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

Great use of Django ORM 👏🏻 .

class BookRating(models.Model):
book = models.ForeignKey(Book, on_delete=models.CASCADE)
ratedBy = models.ForeignKey(User, on_delete=models.CASCADE)
rating = models.FloatField(default=0.0)
Copy link
Member

Choose a reason for hiding this comment

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

Rating given can only be integer as per instructions in README.

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

Successfully merging this pull request may close these issues.

2 participants