def restore_object(self, attrs, instance=None):
    """
    we have to ensure that the temporary_password is attached to the model
    even though it is no field
    """
commenter_pw = attrs.pop('comment_pw', None)
obj = super(CommentCreateSerializer, self).restore_object(attrs, instance=
    instance)
if commenter_pw:
    obj.commenter_pw = commenter_pw
return obj
Добавление поля, которого нет в модели, в сериализатор в среде Django REST