I have a Django model class with a non-model-field property, ex:
def _get(self):
return "something"
description = property(_get)
I’m using the model class with in a ModelForm / ModelFormset. Is there any way to access the property from the form / formset? If not, what’s best practice for including extra “display” data in a django formset?
If your ModelForm was initialized with an instance of a Model, then you can access it through the
instanceattribute. From the ModelForm docs: