MCPcopy Index your code
hub / github.com/PokeAPI/pokeapi / GenerationDetailSerializer

Class GenerationDetailSerializer

pokemon_v2/serializers.py:666–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664
665
666class GenerationDetailSerializer(serializers.ModelSerializer):
667 main_region = RegionSummarySerializer(source="region")
668 names = GenerationNameSerializer(many=True, read_only=True, source="generationname")
669 abilities = AbilitySummarySerializer(many=True, read_only=True, source="ability")
670 moves = MoveSummarySerializer(many=True, read_only=True, source="move")
671 pokemon_species = PokemonSpeciesSummarySerializer(
672 many=True, read_only=True, source="pokemonspecies"
673 )
674 types = TypeSummarySerializer(many=True, read_only=True, source="type")
675 version_groups = VersionGroupSummarySerializer(
676 many=True, read_only=True, source="versiongroup"
677 )
678
679 class Meta:
680 model = Generation
681 fields = (
682 "id",
683 "name",
684 "abilities",
685 "main_region",
686 "moves",
687 "names",
688 "pokemon_species",
689 "types",
690 "version_groups",
691 )
692
693
694########################

Callers

nothing calls this directly

Tested by

no test coverage detected