From e10df9813d1a9f8be1a9e70623a4086c06e9300e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 26 Dec 2017 18:51:41 -0500 Subject: [PATCH] Adding deserialization notes to Changelog --- Changelog.rst | 3 +++ docs/persistence.rst | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.rst b/Changelog.rst index 793ecd35a..f0018794d 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -24,6 +24,9 @@ Release compatible with elasticsearch 6.0, changes include: * methods on ``connections`` singleton are now exposed on the ``connections`` module directly. + * field values are now only deserialized when coming from elasticsearch (via + ``from_es`` method) and not when assigning values in python (either by + direct assignment or in ``__init__``). 5.4.0 (2017-12-06) ------------------ diff --git a/docs/persistence.rst b/docs/persistence.rst index b9e39fa7d..5fab1a848 100644 --- a/docs/persistence.rst +++ b/docs/persistence.rst @@ -150,7 +150,7 @@ If you want to create a model-like wrapper around your documents, use the def add_comment(self, author, content): self.comments.append( - {'author': author, 'content': content}) + Comment(author=author, content=content, created_at=datetime.now())) def save(self, ** kwargs): self.created_at = datetime.now()