def _serialize(self, value, attr, obj):
        """Format and validate the phone number user libphonenumber."""
        value = super(PhoneNumberField, self)._serialize(value, attr, obj)

        if value:
            value = self._format_phone_number(value, attr)

        return value
def _serialize ( self , value , attr , obj ) : value = super ( PhoneNumberField , self ) . _serialize ( value , attr , obj ) if value : value = self . _format_phone_number ( value , attr ) return value
Format and validate the phone number user libphonenumber.