django-timescaledb icon indicating copy to clipboard operation
django-timescaledb copied to clipboard

Add auto_now_add for time field?

Open joshuakoh1 opened this issue 3 years ago • 1 comments

Appreciate if there was a parameter that would set time=NOW() automatically on INSERT

joshuakoh1 avatar Jan 27 '22 06:01 joshuakoh1

You can do this with the following line when declaring you model:

time = TimescaleDateTimeField(auto_now_add=True, interval="1 day")

dreaquil avatar Mar 14 '22 20:03 dreaquil