def initial_value(self, field_name: str = None):
        """
        Get initial value of field when model was instantiated.
        """
        if self._meta.get_field(field_name).get_internal_type() == 'ForeignKey':
            if not field_name.endswith('_id'):
                field_name = field_name+'_id'

        attribute = self._diff_with_initial.get(field_name, None)

        if not attribute:
            return None

        return attribute[0]
def initial_value ( self , field_name : str = None ) : if self . _meta . get_field ( field_name ) . get_internal_type ( ) == 'ForeignKey' : if not field_name . endswith ( '_id' ) : field_name = field_name + '_id' attribute = self . _diff_with_initial . get ( field_name , None ) if not attribute : return None return attribute [ 0 ]
Get initial value of field when model was instantiated.