def __init__(self, *args, **kwargs):
        """
        Dealing with private fields
        """
        private = kwargs.pop('private_fields', None)
        super(PrivateFieldsModelSerializer, self).__init__(*args, **kwargs)
        if private is not None:
            for field_name in private:
                self.fields.pop(field_name)
def __init__ ( self , * args , ** kwargs ) : private = kwargs . pop ( 'private_fields' , None ) super ( PrivateFieldsModelSerializer , self ) . __init__ ( * args , ** kwargs ) if private is not None : for field_name in private : self . fields . pop ( field_name )
Dealing with private fields