

def get_species(self, obj):
    species_objects = []
    if (obj.name == 'female'):
        species_objects = PokemonSpecies.objects.filter(gender_rate__gt=0)
    elif (obj.name == 'male'):
        species_objects = PokemonSpecies.objects.filter(gender_rate__range=[0, 7])
    elif (obj.name == 'genderless'):
        species_objects = PokemonSpecies.objects.filter(gender_rate=(- 1))
    details = []
    for species in species_objects:
        detail = OrderedDict()
        detail['rate'] = species.gender_rate
        detail['pokemon_species'] = PokemonSpeciesSummarySerializer(species, context=self.context).data
        details.append(detail)
    return details

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py GenderDetailSerializer.get_species/original