I'm trying to explore Django and djgono for fun. I want to create a document in the db which is similar to the following document:
{
"title": "Djongo - trying to create a list field",
"body": "I cannot do basic programming...epic fail!",
"tags": ["django","djongo","list"]
}
Following is my code:
from djongo import models
class Post(models.Model):
title = models.CharField(max_length=255)
body = models.TextField(max_length=1000)
tags = models.JSONField()
I tried to add the document from django admin. Entered exactly ["django","djongo","list"]
in the Tags field. I get the following error:
Value: ["django","djongo","list"] stored in DB must be of type dict/listDid you miss any Migrations?
Clearly I am going horribly wrong somewhere. Would be happy if someone pointed me in the right direction.
Thanks!
EDIT: further clarification added.