Как запросить и обновить JsonField модели Django?
Я работаю над проектом, в котором использую Django JSONField для хранения json данных для экземпляра. Когда я пытаюсь запросить объект в соответствии с официальной документацией, он не работает так, как ожидалось. Я не могу запросить объект для обновления значения ключа внутри json-поля. Пожалуйста, приведите ниже подробную информацию для справки и помощи в достижении желаемого результата.
Модель
class PosOrder(models.Model):
store = models.ForeignKey('store.Store', on_delete=models.CASCADE, null=True)
order_number = models.CharField(max_length=30, null=True)
customer_phone = models.CharField(max_length=100, null=True, blank=True)
order_date = models.DateTimeField(auto_now_add=True)
order_total = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
order_discount = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
order_tax = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
coupon = models.ForeignKey('shoppingcoupon.ShoppingCoupon', on_delete=models.PROTECT,
null=True, blank=True)
order_grand_total = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
payment_method = models.CharField(max_length=100, null=True, blank=True, choices=(
('cash', 'Cash'), ('card', 'Card'), ('online', 'Online')))
order_status = models.CharField(max_length=100, null=True, blank=True, choices=order_status)
payment_status = models.CharField(max_length=100, null=True, blank=True,
choices=payment_status)
payment_id = models.CharField(max_length=100, null=True, blank=True)
complete = models.BooleanField(default=False)
order_data = models.JSONField(null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.ForeignKey('hrms.Employee', on_delete=models.CASCADE, null=True,
blank=True)
Jsonfield is like
{"id": 408, "store": {"id": 1, "name": "Salt Lake"}, "order_number": "POS408",
"customer_phone": "9877454577", "order_status": "processed", "payment_status": null
, "payment_method": "cash", "created_at": "2022-08-09T11:38:37.207775+05:30", "created_by":
{"id": 5, "code": "RMS003"}, "get_order_total": 39206, "get_order_tota
l_discount_amount": 2232, "get_order_total_without_tax": 32730, "get_order_total_tax": 6476,
"ordered_items": [{"id": 41, "item": {"id": 3, "product": {"id": 3, "
sku": "TM002", "name": "Striped Men Polo Neck White, Blue, Yellow T-Shirt", "barcode":
"552123", "manufacturer": null, "created_at": "2022-08-06T15:04:05.509651+0
5:30", "category": 1, "brand": null, "size": null, "color": null, "vendor": null,
"created_by": 9}, "mrp": "1599.00", "price_without_tax": "1427.68", "tax": 12, "
tax_amount": "154.19", "discount_percentage": "10.00", "discount_amount": "142.77", "price":
"1439.10", "stock": 100, "created_at": "2022-08-07T17:13:33.640401+05
:30", "updated_at": "2022-08-07T17:13:33.639749+05:30", "store": 1, "created_by": 9, "offers":
[]}, "quantity": 2, "mrp": "1599.00", "price": "1439.10", "discount
": "319.80", "tax": "22.84", "mrp_total": "3198.00", "total_without_tax": "2855.36", "total":
"2878.20", "is_returned": false, "is_exchanged": false, "order": 408
, "offer": null}, {"id": 42, "item": {"id": 2, "product": {"id": 2, "sku": "TFM01", "name":
"Demo 1", "barcode": "012345", "manufacturer": null, "created_at": "20
22-07-29T14:32:14.900200+05:30", "category": 1, "brand": 1, "size": 1, "color": 1, "vendor":
null, "created_by": null}, "mrp": "38240.00", "price_without_tax": "2
9875.00", "tax": 28, "tax_amount": "7946.75", "discount_percentage": "5.00",
"discount_amount": "1493.75", "price": "36328.00", "stock": 100, "created_at": "2022-
08-06T12:15:45.279121+05:30", "updated_at": "2022-08-06T12:15:38+05:30", "store": 1,
"created_by": 1, "offers": [1, 2]}, "quantity": 1, "mrp": "38240.00", "price"
: "36328.00", "discount": "1912.00", "tax": "6453.00", "mrp_total": "38240.00",
"total_without_tax": "29875.00", "total": "36328.00", "is_returned": false, "is_ex
changed": false, "order": 408, "offer": null}]}
Я хочу выложить значение с ключом is_returned
Заранее спасибо