Skip to content

Instantly share code, notes, and snippets.

@mathjazz
Created June 1, 2017 16:22
Show Gist options
  • Select an option

  • Save mathjazz/03fe9ad3352d1e7ecaaa6f81628b848b to your computer and use it in GitHub Desktop.

Select an option

Save mathjazz/03fe9ad3352d1e7ecaaa6f81628b848b to your computer and use it in GitHub Desktop.
Current.py
entities = (
Entity.objects.filter(
Q(translation__string__icontains_collate=search_query, translation__locale=locale) | Q(translation__entity_document__icontains=search),
pk__in=entities
)
.distinct()
)
@mathjazz
Copy link
Author

mathjazz commented Jun 1, 2017

What if we replace translation__entity_document__icontains with entity_document__icontains (and move entity_document to the Entity model)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment