Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions weblate/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand All @@ -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]
Expand Down
Loading