I want to create field that hods list of emails. My model is like this :
class Alerts(models.Model):
emails = MultiEmailField()
events = models.OneToOneField(Event, on_delete=models.CASCADE)
All good, but when this models is saved in DB it is like this
{
"id": 11,
"emails": "['[email protected], [email protected]']",
"events": 13
}
The list in 'emails' key is represented as a string "['[email protected], [email protected]']" , not as a list ['[email protected], [email protected]']. I tried different method, parsers and approaches, but without success. Is there a way to save list in DB or not? If it is the second is there a way to receive back a list as a response, not a string, that is fine too. ( DB is MYSQL)