Let's say my model is:
class Contact(models.Model):
email = models.CharField(max_length=50)
I want to have a serializer that receives multiple fields and then combine them to create an email. For example:
class ContactSerializer(serializers.Serializer):
first = serializers.CharField()
second = serializers.CharField()
third = serializers.CharField()
It would convert {"first": "user", "second": "example", "third": "org"} to a new Contact object with the email '[email protected]'.
What should I do?