python - Filter blank CharField in Django Haystack's SearchQuerySet -


i need return entries in searchqueryset charfield blank i.e. empty string.

in search_indexes.py have:

sometext = indexes.charfield(model_attr='sometext') 

i've tried filtering using usual sqs syntax:

searchqueryset().filter(sometext__exact='') searchqueryset().filter(sometext__in=['', none]) 

neither return blank entries. first returns entries, second returns none @ all.

am missing in searchindex definitions? there way can done in haystack using whoosh backend?

try this, works me:

from haystack.inputs import raw r = searchqueryset() r.exclude(sometext=raw('*')) 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo