1👍
JSON field should be perfect for you. https://docs.djangoproject.com/en/dev/ref/contrib/postgres/fields/#querying-jsonfield
from django.contrib.postgres.fields import JSONField
from django.db import models
class ModelName(models.Model):
json_data = JSONField()
Now to save the data,
ModelName.objects.create(json_data={(0,0):{'a':True,'b':False ... },(0,1):{'a':True,'b':True ... },(1,1):{'a':True,'b':False ... }... })
0👍
PostgreSQL has two types you may want to check out,
Both have overlapping functionality. JSON is part of the SQL 2016 spec though; hstore while having some advantages on JSONB is a PostgreSQL thing
- Could not parse the remainder: '=='Sophia'' from 'abc.first_name=='Sophia'' Python/Django
- What is the best way of saving related model in django admin?
Source:stackexchange.com