From d40ac08059c235dbfbcab25a8bf0cb105d02429c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 22 Mar 2018 16:13:38 +0100 Subject: [PATCH] fix: add support for numerical_value at predicate level --- pytaxonomies/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytaxonomies/api.py b/pytaxonomies/api.py index a9445d8..fa6b099 100644 --- a/pytaxonomies/api.py +++ b/pytaxonomies/api.py @@ -64,6 +64,7 @@ class Predicate(collections.Mapping): self.description = predicate.get('description') self.colour = predicate.get('colour') self.exclusive = predicate.get('exclusive') + self.numerical_value = predicate.get('numerical_value') self.__init_entries(entries) def __init_entries(self, entries): @@ -82,6 +83,8 @@ class Predicate(collections.Mapping): to_return['colour'] = self.colour if self.exclusive: to_return['exclusive'] = self.exclusive + if self.numerical_value is not None: + to_return['numerical_value'] = self.numerical_value if self.entries: to_return['entries'] = self.values() return to_return