You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to actually create django_elasticsearch_dslDocument object that would use, as it's fields, django-parlerTranslatedFields?
My issue is that each language requires different approach so I need to handle each lang specifically.
# documents.py@registry.register_documentclassProductDocument(Document):
'title__cs': fields.TextField(
attr='cs_title_to_string', # <-- HERE! But it's no where near nice solution...fields={
'raw': fields.KeywordField(),
}
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Asked by @ michalpulpan
Is there any way to actually create
django_elasticsearch_dsl
Document
object that would use, as it's fields,django-parler
TranslatedFields
?My issue is that each language requires different approach so I need to handle each lang specifically.
For example model looks like this
What I currently do is to define function on
Product
such as:And later I call it from my
Document
obj.Beta Was this translation helpful? Give feedback.
All reactions