diff --git a/viecpro_typesense/fields.py b/viecpro_typesense/fields.py index dde6ba3..1d28c4c 100644 --- a/viecpro_typesense/fields.py +++ b/viecpro_typesense/fields.py @@ -71,7 +71,7 @@ class Config: class DateObjectDateField(Field): class Config: - handler = StringHandler + handler = DateHandler options = O(type="string") diff --git a/viecpro_typesense/handlers.py b/viecpro_typesense/handlers.py index feaadd8..8086f87 100644 --- a/viecpro_typesense/handlers.py +++ b/viecpro_typesense/handlers.py @@ -36,6 +36,10 @@ class StringHandler(Handler): def func(x): return fixstring(x) if x else "" +class DateHandler(Handler): + def func(x): return str(x) if x else "" + + RelatedIDHandler = StringHandler