Lets have simple model:
class NewModel(models.Model):
json_data = models.JSONField(default=dict)
Then lets get it:
model = NewModel.objects.get(pk=1) # 1
data = model.json_data # 2
value = data.get("key") # 3
Because json_data is pretty big (about 1-2MB per value, and min. 20 values) question is, when django load data to memory?
If I understand correctly then 1 only return point to model but not load it. So it load on attribute call? Or when .get is called?
I want to understand how it works and optimise loading, so I will not load values that are unnecessary.