Postgres 9.4 Django 1.9 get all json keys
I'll suggest the following
list_of_keys = []for obj in File.objects.all().values_list('metadata', flat=True) list_of_keys = list_of_keys + obj.keys()
Now you will have a list of keys, then you can do
set = {}map(set.__setitem__, list_of_keys, [])unique_keys = set.keys()