code: def get_prep_value(self, value):
          
          if value:
              if not isinstance(value, PhoneNumber):
                  value = to_python(value)
              if value.is_valid():
                  format_string = getattr(settings, "PHONENUMBER_DB_FORMAT", "E164")
                  fmt = PhoneNumber.format_map[format_string]
                  value = value.format_as(fmt)
              else:
                  value = self.get_default()
          return super(PhoneNumberField, self).get_prep_value(value)
docs: Perform preliminary non-db specific value checks and conversions.