Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

django - Djano: How to query on json field to get string values stored as json

I have a JSONField column in a data model like this one:

class SomeModel(models.Model):
    extra_data = JSONField(null=True, blank=True)

records in the database contain values of mixed types: actual objects and strings. Like this one:

id extra_data
1 '{"a":1}'
2 {"a": 1}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...