3👍
✅
Use PickledField:
Setup
pip install django-picklefield
Model
from picklefield.fields import PickledObjectField
class MyClass(models.Model):
val = PickledObjectField(default=(0,)*10)
Usage
obj = MyClass()
obj.val[0] = 1
obj.val[5] = 4
obj.save()
val = obj.val[0]
👤nima
Source:stackexchange.com