Data is empty when update to database

I had a problem when i try django, i had a function like this:

def function(id):
   data = { a: "a", b:"b", c:"c" }
   model = Models.objects.get(id=id)
   print(json.dumps(data)) # when try to print this, there is a value 
   model.data = json.dumps(data) 
   # but when i tried to update my table in db, sometimes there is value, and sometimes is empty
   model.save()

is anyone had any issues like this before? Thanks

Back to Top