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": "['ht@ht.com, bb@bb.com']",
"events": 13
}
The list in 'emails' key is represented as a string "['ht@ht.com, bb@bb.com']" , not as a list ['ht@ht.com, bb@bb.com']. 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)