diff --git a/weblate/utils/db.py b/weblate/utils/db.py index 340788e7dec0..85b860afac4b 100644 --- a/weblate/utils/db.py +++ b/weblate/utils/db.py @@ -9,7 +9,7 @@ import time from django.db import ProgrammingError, connections, transaction -from django.db.models.lookups import PatternLookup, Regex +from django.db.models.lookups import Lookup, PatternLookup, Regex from .inv_regex import invert_re @@ -59,7 +59,7 @@ def count_alnum(string): return sum(map(str.isalnum, string)) -class PostgreSQLFallbackLookupMixin: +class PostgreSQLFallbackLookupMixin(Lookup): """ Mixin to block PostgreSQL from using trigram index. @@ -70,8 +70,6 @@ class PostgreSQLFallbackLookupMixin: It is performed by concatenating empty string which will prevent index usage. """ - lookup_name: str - def process_lhs(self, compiler, connection, lhs=None): if self._needs_fallback: # type: ignore[attr-defined] lhs_sql, params = super().process_lhs(compiler, connection, lhs) # type: ignore[misc]