Answers for "How to save a ManyToManyField as a value instead of id"

0

How to save a ManyToManyField as a value instead of id

class Symptoms(DynamicSerializer):
    class Meta:
        model = models.Symptom
        fields = ('name',) #< instead of id use other value


class PatientProfiel(DynamicSerializer):
    symptoms = SymptSer(many=True) #< it it here
    class Meta:
        model = MyModel
        fields = '__all__'
Posted by: Guest on June-05-2021

Code answers related to "How to save a ManyToManyField as a value instead of id"

Browse Popular Code Answers by Language