我正在开发一个需要实现搜索引擎的多语言应用程序,我选择了 haystack。
这是我要索引的模型
class Post(TranslatableModel):
category = models.ForeignKey(
Category,
related_name='posts',
verbose_name=_(u'Categoría')
)
slug = AutoSlugField(
populate_from='title'
)
featured_picture = ThumbnailerImageField(
upload_to='blog/posts/featured-pictures',
verbose_name=_(u'Imagen destacada'),
help_text=_(u'Tamaño: 850 x 423px. Será recordada si no.')
)
box_bg = models.CharField(
max_length=20,
verbose_name=_(u'Color de fondo de la caja'),
choices=SERVICE_BOX_COLORS,
# Could be an image
null=True, blank=True
)
box_image_bg = ThumbnailerImageField(
upload_to='blog/posts/background-images',
verbose_name=_(u'Imagen de fondo de la caja'),
null=True, blank=True,
help_text=_(u'Tamaño: 500 x 500px. Será recordada si no.')
)
translations = TranslatedFields(
title=models.CharField(
max_length=100,
verbose_name=_(u'Título')
),
content=RichTextField(
verbose_name=_(u'Contenido')
),
meta_description=models.TextField(
verbose_name=_(u'Meta description (SEO)'),
help_text=_(u'Máximo 160 caracteres.'),
max_length=160
)
)
我不知道大海捞针如何处理hvad翻译字段