3

我一直在使用这个 gist 将并行翻译添加到 Mezzanine(版本 1.4.16):https ://gist.github.com/3596248

Mezzanine 默认情况下不包括搜索中的翻译字段。看起来好像有必要专门告诉 Mezzanine 在搜索时它应该包括其他字段。Mezzanine 关于创建自定义内容类型的文档在http://mezzanine.jupo.org/docs/search-engine.html中提供了一个示例,将以下示例行添加到 models.py :

objects = SearchableManager()
    search_fields = ("title", "description")

我没有成功地尝试过以下方面的变化:

class TransRichTextPage(Translatable, RichText, Slugged):
    translation = models.ForeignKey(RichTextPage, related_name="translation")
    objects=SearchableManager()
    search_fields=("translation.title","translation.content");
4

0 回答 0