Skip to content

Commit

Permalink
Merge pull request #515 from iommirocks/vector-search-field
Browse files Browse the repository at this point in the history
SearchVectorField default None factory
  • Loading branch information
jlubcke authored Feb 18, 2024
2 parents 1ea3f0b + 304e829 commit 2436317
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iommi/_db_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def char_field_column_factory(model_field, **_):
register_filter_factory(CharField, factory=char_field_filter_factory)
register_column_factory(CharField, factory=char_field_column_factory)

try:
from django.contrib.postgres.search import SearchVectorField
register_factory(SearchVectorField, factory=None)
except ImportError:
pass
register_factory(UUIDField, shortcut_name='text')
register_factory(TimeField, shortcut_name='time')
register_factory(EmailField, shortcut_name='email')
Expand Down

0 comments on commit 2436317

Please sign in to comment.