forked from open-eats/OpenEats
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Save average rating instead of calculating it with every request #12
Comments
sepulzera
added a commit
that referenced
this issue
May 22, 2022
Closed
sepulzera
added a commit
to ownrecipes/ownrecipes-api
that referenced
this issue
Jan 25, 2024
See ownrecipes/OwnRecipes#12 Fixes also ordering of recipes See ownrecipes/OwnRecipes#42 Fixes also search for recipes without ratings See ownrecipes/OwnRecipes#65
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In recipe.views.py the average of all ratings for every recipe gets calculated with every request.
Please add a new field to recipe "rating_avg" and update this field with every creation and deletion of a rating.
Do not forget about the migration of existing recipes and ratings and calculate the "rating_avg" in the migration once.
The text was updated successfully, but these errors were encountered: