crate/cratedb-django

Support `TimeField`

開放

#53 建立於 2025年12月24日

 (0 則留言) (0 個反應) (0 位負責人)Python (4 個分叉)auto 404
enhancementgood first issue

倉庫指標

星標
 (6 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南