How to store a dictionary in a Django database model's field

前端 未结 9 1387
不思量自难忘°
不思量自难忘° 2020-12-03 20:31

I need to save a dictionary in a model\'s field. How do I do that?

For example I have this code:

def create_random_bill(self):
    name_chars = re.co         


        
9条回答
  •  醉梦人生
    2020-12-03 21:21

    If postgres is your backend, consider the hstore field which has native support from django

提交回复
热议问题