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

APIv2 : Add filter by ratings on outdoor courses and sites #2768

Merged
merged 12 commits into from
Sep 24, 2021

Conversation

Chatewgne
Copy link
Contributor

No description provided.

@cypress
Copy link

cypress bot commented Sep 23, 2021



Test summary

18 0 0 0


Run details

Project Geotrek-admin
Status Passed
Commit a95f7b3
Started Sep 24, 2021 1:29 PM
Ended Sep 24, 2021 1:32 PM
Duration 02:34 💡
OS Linux Ubuntu Linux - 14.04
Browser Electron 80

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #2768 (a95f7b3) into master (735acdc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2768   +/-   ##
=======================================
  Coverage   97.27%   97.27%           
=======================================
  Files         287      287           
  Lines       19884    19916   +32     
=======================================
+ Hits        19342    19374   +32     
  Misses        542      542           
Impacted Files Coverage Δ
geotrek/api/v2/views/outdoor.py 100.00% <ø> (ø)
geotrek/api/v2/filters.py 100.00% <100.00%> (ø)
geotrek/outdoor/models.py 99.64% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 735acdc...a95f7b3. Read the comment docs.

# Exclude if ratings in hierarchy don't match any wanted ratings
found_ratings = site.super_ratings_id
if found_ratings.isdisjoint(wanted_ratings):
queryset = queryset.exclude(id=site.pk)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je sais que ce n'est pas idéal d'itérer sur le queryset, mais vu la complexité pour récupérer les pratiques et les cotations des sites enfants, je n'ai pas d'autre idées

Copy link
Member

Choose a reason for hiding this comment

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

Ok, pour le moment on valide comme ça. Si ca pose des problèmes de perf on prendra le temps de réfléchir à une meilleure manière de faire alors.
Met juste un commentaire en TODO dans le code qu'on puisse savoir que c'est optimisable.

@Chatewgne Chatewgne marked this pull request as ready for review September 24, 2021 08:26
# Exclude if ratings in hierarchy don't match any wanted ratings
found_ratings = site.super_ratings_id
if found_ratings.isdisjoint(wanted_ratings):
queryset = queryset.exclude(id=site.pk)
Copy link
Member

Choose a reason for hiding this comment

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

Ok, pour le moment on valide comme ça. Si ca pose des problèmes de perf on prendra le temps de réfléchir à une meilleure manière de faire alors.
Met juste un commentaire en TODO dans le code qu'on puisse savoir que c'est optimisable.

@Chatewgne Chatewgne merged commit 9908bf3 into master Sep 24, 2021
@submarcos submarcos deleted the api_filter_cotations branch November 16, 2021 10:46
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.

None yet

2 participants