How to manually populate Many-To-Many fields through JSON fixture in Django
Question: I have a JSON fixture and I want to populate a many-to-many field from my JSON
fixture but it seems Django only wants just one pk but I need to pass in a lot
of integers representing pks for the other related fields.

IS there anyway to go about this.

I have used a `raw_id = ['reference(my table name)']` in the `ModelAdmin` so
that pks can be used to reference the related fields.

The error message is

> File "/usr/local/lib/python2.7/dist-
> packages/django/core/serializers/python.py", line 142, in Deserializer raise
> base.DeserializationError.WithData(e, d['model'], d.get('pk'), pk)
> django.core.serializers.base.DeserializationError: Problem installing
> fixture '/home/user/Desktop/File/data/file.json':
>
> `[u"',' value must be an integer."]: (kjv.verse:pk=1) field_value was ','`


Answer: You can use `JSONField()` for django model

    
    
    from django.contrib.postgres.fields import JSONField
    raw_id=JSONField(primary_key=True,db_index=True,null=True)
    

S0 your database will be like `{raw_id:[1,2,3,4]}`

