|
I have created a custom model which will store a list of values for various nodes:
ie, based on the body of a question I will store some values, such as the names that appear in that question. So my custom model would have the values "Mike" and "John" stored for a question. This way I can search my model to see which questions reference mike or john. However, the same will go for an answer or a comment. Therefore I will be able to search to see if any question, answer, or comment has the reference i'm looking for. This is fine, but, if I search for my search term I end up with a list of nodes. What I really want is a list of questions whose children have the search term. ie, question x and the answer to question y each contain my search term. I want a list that includes question x and question y when I look for my search term. Is there a simple way to reduce the queryset of nodes to a queryset of questions? I hope this made sense? |