feat: fallback front_female sprite to front_default for female-only p…#1573
Open
programgames wants to merge 2 commits into
Open
feat: fallback front_female sprite to front_default for female-only p…#1573programgames wants to merge 2 commits into
programgames wants to merge 2 commits into
Conversation
sprite keys with their default counterparts across all sprite sections.
379ce9e to
416c268
Compare
Naramsim
reviewed
Jun 26, 2026
| serializer_class = PokemonDetailSerializer | ||
| list_serializer_class = PokemonSummarySerializer | ||
|
|
||
| def get_queryset(self): |
Member
There was a problem hiding this comment.
Very interesting implementation. Can I ask what's the purpose of this function? It's for having ready at hand some data later on in the serializer.py part?
phalt
reviewed
Jun 26, 2026
| "back_shiny_female": "back_shiny", | ||
| } | ||
|
|
||
| def _fill_female_sprites(self, node): |
Member
There was a problem hiding this comment.
I'm strongly of the opinion that the data should just be shared with PokeAPI and consumers should handle this themselves.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes description
A simple solution for the #271 .
If the request if a simple GET for the pokemon, we select the specie and check if the gender rate is only female.
In this case we copy the valuer from default to female sprites with this mapping :
PS : I would like to know if Pokemon.objects.all().select_related("pokemon_species") could be a performance problem on the server, Should I test performance before and after this change to compare ?