ulule/django-linguist

Using ...objects.filter() on a translated field

jrief opened this issue · 2 comments

My model has a translated field named slug. If I want to find that object using
MyModel.objects.filter(slug='something') then I get:

File "django/db/models/sql/query.py", line 1283, in names_to_path
FieldError: Cannot resolve keyword 'slug' into field.

But if I try with MyModel.objects.filter(slug_en='something') then I get

  File "django/db/backends/mysql/base.py", line 295, in quote_name
    if name.startswith("`") and name.endswith("`"):
AttributeError: 'NoneType' object has no attribute 'startswith'

The documentation does not mention how to filter on translated fields. Is this implemented?

This is not implemented, columns are in a separate table so you can't filter them at the moment.

thoas commented

fixed