How to create a Django GeneratedField for extracting a timestamp from a UUIDv7

I recently read How to use UUIDv7 in Python, Django and PostgreSQL from Paolo Melchiorre . I particularly liked the section demonstrating how to extend the model with a generated column that stores the timestamp extracted from the UUID. from django.db import models class UUIDv7 (models . Func): function = 'uuidv7' output_field = models . UUIDField() class UUIDExtractTimestamp (models . Func):…