Skip to content
Commits on Source (2)
[bumpversion]
current_version = 0.3.16
current_version = 0.3.17
commit = True
tag = True
......
......@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [0.3.15] - 2017-01-14
## [0.3.17] - 2018-01-14
### Fixed
- Real value gettting for list link field fix again
## [0.3.15] - 2018-01-14
### Fixed
......
......@@ -8,7 +8,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......@@ -13,7 +13,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -6,7 +6,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -17,7 +17,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -12,7 +12,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......@@ -91,10 +91,9 @@ class LinkListField(AbstractField):
return value_ids
def real_value(self, model_record):
value_ids = model_record._values[self.name]
if value_ids != list(map(lambda x: x.id, self._created_list)):
value_ids = self._fetch_from_model_list(model_record)
return value_ids
if self._created_list is not None:
return self._fetch_from_model_list(model_record)
return model_record._values[self.name]
async def async_format(self, value) -> str: # pylint: disable=no-self-use
return self.format(await ensure_element(value))
......@@ -107,7 +106,8 @@ class LinkListField(AbstractField):
if self.name is not None:
return self._query_row
return self
if not self._created_list:
if self._created_list is None:
self._created_list = []
model_ids = instance._values.get(self.name)
if model_ids:
for model_id in model_ids:
......@@ -116,8 +116,6 @@ class LinkListField(AbstractField):
if model_id is not None:
result = get_model_and_load_to_cache(self._model_class, instance, model_id)
self._created_list.append(result)
else:
instance._values[self.name] = []
return self._created_list
def __set__(self, instance, value) -> None:
......@@ -128,12 +126,13 @@ class LinkListField(AbstractField):
if not isinstance(value_record, (self._model_class, asyncio.Future, str)):
raise ValueError(f"This field only for model for {self._model_class}")
# None value should be converted to empty list
self._created_list.clear()
if self._created_list is not None:
self._created_list.clear()
if not value:
self._created_list = []
instance._values[self.name] = []
elif isinstance(value[0], str):
self._created_list = []
self._created_list = None
instance._values[self.name] = value
else:
self._created_list = value
......
......@@ -9,7 +9,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -16,7 +16,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -6,7 +6,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -8,7 +8,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -9,7 +9,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -9,7 +9,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -7,7 +7,7 @@ __author__ = "Bogdan Gladyshev"
__copyright__ = "Copyright 2017, Bogdan Gladyshev"
__credits__ = ["Bogdan Gladyshev"]
__license__ = "MIT"
__version__ = "0.3.16"
__version__ = "0.3.17"
__maintainer__ = "Bogdan Gladyshev"
__email__ = "siredvin.dark@gmail.com"
__status__ = "Production"
......
......@@ -11,7 +11,7 @@ with open('README.rst') as readme_file:
setup(
name='anji-orm',
version='0.3.16',
version='0.3.17',
description="RethinkDB based ORM",
long_description=readme,
author="Bogdan Gladyshev",
......
......@@ -59,9 +59,9 @@ author = 'Bogdan Gladyshev'
# built documents.
#
# The short X.Y version.
version = '0.3.16'
version = '0.3.17'
# The full version, including alpha/beta/rc tags.
release = '0.3.16'
release = '0.3.17'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......