有没有人有使用任何经验django-haystack
与whoosh
后端?
我希望将它用于分类的实时搜索类型工具.在生产环境中是否足够快/高效以避免设置solr
或xapian
?
我正在使用Sympy的sympify函数来简化2个表达式,所以我可以比较它们的相等性.
例如:
expr1 = sympify("(2 * x) + (x + 10)")
expr2 = sympify("(x + 10) + (x * 2)")
if expr1 == expr2:
print "Congrats those are essentially the same!"
Run Code Online (Sandbox Code Playgroud)
但是当使用表格2x作为x*2时,我得到一个解析异常,例如:
expr1 = sympify("2x + (x + 10)")
Run Code Online (Sandbox Code Playgroud)
有什么方法可以让我很同意理解2x表格吗?
如果没有,是否有其他库允许此表格?
当使用django.contrib.comments时,无论如何都要将反向关系添加到有注释的模型中?
例如:
post = Post.objects.all()[0]
comments = post.comments.all()
Run Code Online (Sandbox Code Playgroud)