This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You have a model something like this | |
from django.contrib.postgres.fields import JSONField | |
class MyModel(models.Model): | |
jsonfield = JSONField() # {"name": "Gaurav", "age": "25", "address": {"country": "India", "city": "Jaipur"}} | |
# few more fields... | |
# And in admin you want to create filter for jsonfield properties/keys | |
# for e.g. in above case we want to show filter for age and country |