Skip to content

Commit

Permalink
SearchVectorField default None factory
Browse files Browse the repository at this point in the history
  • Loading branch information
boxed committed Feb 16, 2024
1 parent 18b45b0 commit 304e829
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 304e829

Please sign in to comment.