1👍
✅
I think you should be able to just remove the json.dumps part of the script. That’s a python command to translate a valid JSON object into a string!
data = list(Data.objects.all().values('deviceId','payload'))
0👍
To store JSON I recommended to use JSONField.
from jsonfield import JSONField
class Data(models.Model):
deviceId = models.CharField(max_length=200)
payload = models.JSONField(max_length=2000)
👤slav
- [Answer]-Cannot upload profile picture in django
- [Answer]-Haystack: stats() and stats_results() doesn't work
Source:stackexchange.com