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

Make average rating a property of the Edition model #3424

Open
lenikadali opened this issue Aug 29, 2024 · 0 comments · May be fixed by #3425
Open

Make average rating a property of the Edition model #3424

lenikadali opened this issue Aug 29, 2024 · 0 comments · May be fixed by #3425

Comments

@lenikadali
Copy link

Description

Currently when displaying the ratings of a given book, we calculate the average rating of the book from within the book view as shown here

It would make more sense for us to have an average_rating function which is a @property function on the Edition model.

Then average_rating would return the query (currently ....aggregate(Avg("rating"))["rating__avg"]) which produces the average rating of the book.

@lenikadali lenikadali linked a pull request Aug 29, 2024 that will close this issue
14 tasks
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 a pull request may close this issue.

1 participant