def get_candidates(self, obj):
        """
        CandidateElections.
        """
        return CandidateElectionSerializer(
            obj.candidate_elections.all(), many=True
        ).data
def get_candidates ( self , obj ) : return CandidateElectionSerializer ( obj . candidate_elections . all ( ) , many = True ) . data
CandidateElections.