<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def db_value(self, value):
 """Convert the Pendulum instance to a datetime for saving in the db."""

        if isinstance(value, pendulum.Pendulum):
            value = datetime.datetime(
                value.year, value.month, value.day, value.hour, value.minute,
                value.second, value.microsecond, value.tzinfo
            )

        return super(PendulumDateTimeField, self).db_value(value)