Questions tagged [django-jsonfield]

162 questions
1
vote
1 answer

Django ordering by JSONField key

I have the following django model with a JSONField: class TestModel(models.Model): data = JSONField(default={}) And data field with struct bellow: { "a": 1, "b": 2, } How ordering queryset by one of the data…
1
vote
0 answers

Django GenericRelation vs. JSONField

In my application a number of different kinds of Records can be mapped to a Person. In my initial implementation, I made each record inherit from an abstract base class and used GenericRelations to manage the whole thing. The code is a bit…
TAH
  • 1,658
  • 1
  • 19
  • 37
1
vote
1 answer

Django JSONField string containment

Using Django 1.10's JSONField, i want to filter queryset by the json field that have a value at specific key that contains a sub string (sql like). e.g. there is a json field link, with the url key. i want the objects that it's url contains .jpg
Mohsen
  • 661
  • 1
  • 6
  • 10
1
vote
1 answer

InterfaceError for a custom JSONField for Django

I am trying to build a custom JSON Field for Django projects that support MySQL. This is my models: from __future__ import unicode_literals from django.db import models from django.db import models from django.core.serializers.json import…
darkhorse
  • 8,192
  • 21
  • 72
  • 148
1
vote
1 answer

django json field: which one?

I am looking for a JSON field for Django. I have found mainly 2 jsonfield app and I am not sure which one I should use. The main difference I see is that the first one does not have the native JSON datatype support for PostgreSQL anymore. It has…
Michael
  • 8,357
  • 20
  • 58
  • 86
0
votes
1 answer

If statement in Django and Json

I have a script like this for adding the data of the table from a JSON.