(self, value)
return [self._tobytes(x) for x in value]
Normalize values to bytes
Normalize values to bytes
Normalize values to bytes
def normvalue(self, value):
        """Normalize values to bytes"""
        if value is None:
            value = []
        elif isinstance(value, (str, bytes)):
            value = [value]
        elif not hasattr(value, '__iter__'):
            value = [value]

        return [self._tobytes(x) for x in value]
def normvalue ( self , value ) : if value is None : value = [ ] elif isinstance ( value , ( str , bytes ) ) : value = [ value ] elif not hasattr ( value , '__iter__' ) : value = [ value ] return [ self . _tobytes ( x ) for x in value ]