所以基本上我想创建一个搜索机制,其中输入是一个空格分隔的字符串,例如:
terms = "these are some search terms"
...可以使用可变数量的术语,最终使用模型查询过滤器,例如:
Term.objects.filter(Q(term__contains='these') | Q(term__contains='are') | Q(term__contains='some') | Q(term__contains='search') | Q(term__contains='terms'))
当然,如果有更好的方法可以做到这一点,那么我很灵活:)但是我无法弄清楚如何构造过滤器参数。
由于