Django modifies part of the data in a row of the data table

The

data table has 30 fields, and the json passed from the front end corresponds to 10 fields. How to easily modify the values of these fields.
Front-end json:

{ 
    name: "a",
    active: "play" 
}

I don"t want to assign values explicitly, such as

mydb.name = json["name"]
mydb.active = json["play"]

you can"t write 30 assignments.
is there a way to solve this problem in a way similar to cyclic traversal assignment.

ask all the gods to help

Mar.28,2021

modelA  ab
class A(models.Model):
    a = models.CharField(max_length=1)
    b = models.CharField(max_length=1)
test_json = {
    'a':'test'
    'b':'test'
}
jsonkey  model(key) 
A.objects.update(**test_json)
Menu