I have a text area that lets a user build their own string which may look like any mix of AND OR NOT between words
ex:
"'disease' AND 'chemical' OR 'toxic' NOT 'imflammation' AND ('foo' OR 'bar')"
They are able to add words from a list, can click the appropriate button to add the AND OR NOT, and add parenthesis. So a string like that is what will be passed from my javascript to Django for me to parse/format to make a query. I can't find much about building a Django query that will handle boolean queries like that though. I don't really know where to start. I'm running MySQL on the backend too. Thanks for any help!
edit: the table I'm querying has a text column and the search will be directed at that. I'm trying to avoid doing a raw sql search in Django. I'm currently searching for things that can either convert any MySQL query to the appropriate Django query or ways to take a string and build a Django query directly from the string (the parenthesis are the hard part I think).