title: In django queryset filter, how to check if at least one key in json field has non empty value?
body: <pre><code>class Library(models.model):
      book = JSONField(default=[], blank=True, null=True)
  </code></pre>
  
  <p>possible structure of 'book' is {'title':'' ,'no_of_pages': '', 'author_name': '', 'color': '', edition: ''}</p>
  
  <p>I am trying to write a django query that returns only records where book has at least one key with non empty value ( i.e either <em>title</em> or <em>no_of_pages</em> or <em>author_name</em> or <em>color</em> or <em>edition</em> has some value)</p>
  
  <p>one possible solution to this is something like:</p>
  
  <pre><code>Author.objects.filter(
      ~Q(book__title='') |
      ~Q(book__no_of_pages='') | 
      ~Q(book__author_name='') |
      ~Q(book__color='') |
      ~Q(book__edition='')
  )
  </code></pre>
  
  <p>is there any better way to do this ? There may be case where book can have some additional keys in future like <em>publisher</em> or <em>availabilty</em></p>
  
  <p>How can I perform this filter without having to mention the specific keys of the field ( just check at least one key with some value) ? or any shorter method to write this query with all the keys mentioned ?</p>