crate/cratedb-django

Support `TimeField`

Aberta

#53 aberto em 24 de dez. de 2025

 (0 comentário) (0 reação) (0 responsável)Python (4 forks)auto 404
enhancementgood first issue

Métricas do repositório

Stars
 (6 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

CrateDB does not support storage for timetz, all times have to be stored either in a timestamp or timestamptz.

TimeField only takes the time part of a timestamp, CrateDB trips if we try to do:

TimeField(datetime.datetime.now().time().isoformat())
# SQLParseException[Cannot cast value `22:43:10.001021` to type `timestamp without time zone`]

Because CrateDB needs the full timestmap.

But if we pass a timestamp, the validator of the field trips with: django.core.exceptions.ValidationError: ['“2020-01-01T22:43:10.001021” value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.']

To fix this we should modify the validator of cratedb.fields.TimeField

Guia do colaborador