| 5250 | |
| 5251 | |
| 5252 | class PokemonSpeciesDetailSerializer(serializers.ModelSerializer): |
| 5253 | names = serializers.SerializerMethodField("get_pokemon_names") |
| 5254 | form_descriptions = PokemonSpeciesDescriptionSerializer( |
| 5255 | many=True, read_only=True, source="pokemonspeciesdescription" |
| 5256 | ) |
| 5257 | pokedex_numbers = PokemonDexEntrySerializer( |
| 5258 | many=True, read_only=True, source="pokemondexnumber" |
| 5259 | ) |
| 5260 | egg_groups = serializers.SerializerMethodField("get_pokemon_egg_groups") |
| 5261 | flavor_text_entries = PokemonSpeciesFlavorTextSerializer( |
| 5262 | many=True, read_only=True, source="pokemonspeciesflavortext" |
| 5263 | ) |
| 5264 | genera = serializers.SerializerMethodField("get_pokemon_genera") |
| 5265 | generation = GenerationSummarySerializer() |
| 5266 | growth_rate = GrowthRateSummarySerializer() |
| 5267 | color = PokemonColorSummarySerializer(source="pokemon_color") |
| 5268 | habitat = PokemonHabitatSummarySerializer(source="pokemon_habitat") |
| 5269 | shape = PokemonShapeSummarySerializer(source="pokemon_shape") |
| 5270 | evolves_from_species = PokemonSpeciesSummarySerializer() |
| 5271 | varieties = serializers.SerializerMethodField("get_pokemon_varieties") |
| 5272 | evolution_chain = EvolutionChainSummarySerializer() |
| 5273 | pal_park_encounters = serializers.SerializerMethodField("get_encounters") |
| 5274 | |
| 5275 | class Meta: |
| 5276 | model = PokemonSpecies |
| 5277 | fields = ( |
| 5278 | "id", |
| 5279 | "name", |
| 5280 | "order", |
| 5281 | "gender_rate", |
| 5282 | "capture_rate", |
| 5283 | "base_happiness", |
| 5284 | "is_baby", |
| 5285 | "is_legendary", |
| 5286 | "is_mythical", |
| 5287 | "hatch_counter", |
| 5288 | "has_gender_differences", |
| 5289 | "forms_switchable", |
| 5290 | "growth_rate", |
| 5291 | "pokedex_numbers", |
| 5292 | "egg_groups", |
| 5293 | "color", |
| 5294 | "shape", |
| 5295 | "evolves_from_species", |
| 5296 | "evolution_chain", |
| 5297 | "habitat", |
| 5298 | "generation", |
| 5299 | "names", |
| 5300 | "pal_park_encounters", |
| 5301 | "form_descriptions", |
| 5302 | "flavor_text_entries", |
| 5303 | "genera", |
| 5304 | "varieties", |
| 5305 | ) |
| 5306 | |
| 5307 | @extend_schema_field( |
| 5308 | field={ |
| 5309 | "type": "array", |
nothing calls this directly
no test coverage detected