il2_rest/models.py
def default(self, obj) :
        """
        Set the behavior of the encoder depending on the type of obj.

        """
        if isinstance(obj, datetime.datetime) :
            t = obj.strftime('%Y-%m-%dT%H:%M:%S.%f')
            z = obj.strftime('%z')
            if len(z) >=5 :
                z = z[:-2] + ':' + t[-2:]
            return t + z
        elif isinstance(obj, Color) :
            return obj.web
        elif isinstance(obj, version.Version) :
            return str(obj)
        elif isinstance(obj, LimitedRange) :
            return str(obj)
        elif isinstance(obj, bytes) :
            return base64.b64encode(obj).decode('utf-8')
        elif issubclass(type(obj), Enum) :
            return obj.value
        elif issubclass(type(obj), AppPermissions) :
            return obj.to_str()
        else :
            return obj.__dict__

        Set the behavior of the encoder depending on the type of obj.

        
Set the behavior of the encoder depending on the type of obj.
Set the behavior of the encoder depending on the type of obj .
def default(self, obj) :
        if isinstance(obj, datetime.datetime) :
            t = obj.strftime('%Y-%m-%dT%H:%M:%S.%f')
            z = obj.strftime('%z')
            if len(z) >=5 :
                z = z[:-2] + ':' + t[-2:]
            return t + z
        elif isinstance(obj, Color) :
            return obj.web
        elif isinstance(obj, version.Version) :
            return str(obj)
        elif isinstance(obj, LimitedRange) :
            return str(obj)
        elif isinstance(obj, bytes) :
            return base64.b64encode(obj).decode('utf-8')
        elif issubclass(type(obj), Enum) :
            return obj.value
        elif issubclass(type(obj), AppPermissions) :
            return obj.to_str()
        else :
            return obj.__dict__
def default ( self , obj ) : if isinstance ( obj , datetime . datetime ) : t = obj . strftime ( '%Y-%m-%dT%H:%M:%S.%f' ) z = obj . strftime ( '%z' ) if len ( z ) >= 5 : z = z [ : - 2 ] + ':' + t [ - 2 : ] return t + z elif isinstance ( obj , Color ) : return obj . web elif isinstance ( obj , version . Version ) : return str ( obj ) elif isinstance ( obj , LimitedRange ) : return str ( obj ) elif isinstance ( obj , bytes ) : return base64 . b64encode ( obj ) . decode ( 'utf-8' ) elif issubclass ( type ( obj ) , Enum ) : return obj . value elif issubclass ( type ( obj ) , AppPermissions ) : return obj . to_str ( ) else : return obj . __dict__
Set the behavior of the encoder depending on the type of obj.
Set the behavior of the encoder depending on the type of obj .
"""
        Set the behavior of the encoder depending on the type of obj.

        """
self
obj