1👍
✅
Try this for related fields:
ft = field.related_model._meta.pk.db_type(connection=connection)
model.pk
is indeed a property that gets you the value of the pk for a model instance. model._meta.pk
is the actual Field
instance that is the primary key for that model.
👤knbk
Source:stackexchange.com