instance.author = attrs.get('author', instance.author)
instance.url = attrs.get('url', instance.url)
instance.content = attrs.get('content', instance.content)
instance.ip = attrs.get('ip', instance.ip)
instance.post_title = attrs.get('post_title', instance.post_title)
instance.post_url = attrs.get('post_url', instance.post_url)
return instance
commenter_pw = attrs.get('commenter_pw')
del attrs['commenter_pw']
comment = Comment(**attrs)
comment.commenter_password = commenter_pw
return comment
Добавление поля, которого нет в модели, в сериализатор в среде Django REST