Question
What is the best way to set a JSONField
to have the default value of a new list in django
?
Context
There is a model where one of the fields is a list of items. In the case where there are no items set, the model should have an empty list.
Current solution
from django.models import Model
class MyModel(Model):
the_list_field = JSONField(default=[])
Is this the best way to do it? Should it be switched to use list
instead?
Thanks!