#36265: Generated Field with TruncDate and tzinfo
---------------------------------+--------------------------------------
Reporter: sandeepharlalka | Type: Bug
Status: new | Component: Migrations
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
in settings.py
{{{
USE_TZ = True
}}}
In models.py
{{{
class MyClass:
timestamp = models.DateTimeField()
date = models.GeneratedField(
expression=TruncDate('timestamp', tzinfo=INDIA_TIMEZONE),
output_field=models.DateField(),
db_persist=True,
)
}}}
makemigrations:
ValueError: Cannot serialize: zoneinfo.ZoneInfo(key='Asia/Kolkata')
date field is added after the table has already been created.
--
Ticket URL: <https://code.djangoproject.com/ticket/36265>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070195ad6ba12f-b2ef0b3c-7676-473b-8999-61392a7cbcc7-000000%40eu-central-1.amazonses.com.