-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BSR)[API] feat: load GooglePlacesInfo here to save a query later
- Loading branch information
Showing
1 changed file
with
1 addition
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ def get_offer(offer_id: str) -> serializers.OfferResponse: | |
.joinedload(Venue.managingOfferer) | ||
.load_only(Offerer.name, Offerer.validationStatus, Offerer.isActive) | ||
) | ||
.options(joinedload(Offer.venue).joinedload(Venue.googlePlacesInfo)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
thconte
Author
Contributor
|
||
.options(joinedload(Offer.mediations)) | ||
.options(joinedload(Offer.product).load_only(Product.id, Product.thumbCount)) | ||
.outerjoin(Offer.lastProvider) | ||
|
@thconte : ce serait top d'ajouter un
assert_num_queries
dans un test de la route pour s'assurer qu'il n'y a pas de régression et qu'il n'y a pas d'autres requêtes SQL N+1 non détectées.