<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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]