From 304e829ad8d8d951994cd32831fa006c24514c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Hovm=C3=B6ller?= Date: Fri, 16 Feb 2024 15:45:50 +0100 Subject: [PATCH] SearchVectorField default None factory --- iommi/_db_compat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iommi/_db_compat.py b/iommi/_db_compat.py index 3f26982d..33b1e674 100644 --- a/iommi/_db_compat.py +++ b/iommi/_db_compat.py @@ -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')