diff --git a/CHANGELOG.md b/CHANGELOG.md index d168b98c6e488fd99ee4670c4495e07b62ab08d5..569d2fc31161d059d191d142783be74c11fc33ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 of a `Container`, removing all useful methods of the `Container` class. This has been fixed and using a `slice` such as `[:2]` now returns a new `Container`. +* [#120](https://gitlab.com/linkahead/linkahead-pylib/-/issues/120) Unwanted + subproperties in reference properties. ### Security ### diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index b087496d1db9800b352f4b4cc916ea084b2c83f6..970d373a6cda57e87bf5abfdf7362c24e911d42f 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -109,7 +109,7 @@ FIX = "FIX" ALL = "ALL" NONE = "NONE" if TYPE_CHECKING: - INHERITANCE = Literal["OBLIGATORY", "SUGGESTED", "RECOMMENDED", "ALL", "NONE"] + INHERITANCE = Literal["OBLIGATORY", "SUGGESTED", "RECOMMENDED", "ALL", "NONE", "FIX"] IMPORTANCE = Literal["OBLIGATORY", "RECOMMENDED", "SUGGESTED", "FIX", "NONE"] SPECIAL_ATTRIBUTES = ["name", "role", "datatype", "description", @@ -2382,7 +2382,8 @@ class _Properties(list): return self._importance.get(property) - def set_importance(self, property: Optional[Property], importance: IMPORTANCE): # @ReservedAssignment + # @ReservedAssignment + def set_importance(self, property: Optional[Property], importance: IMPORTANCE): if property is not None: self._importance[property] = importance @@ -2420,7 +2421,7 @@ class _Properties(list): if inheritance is not None: self._inheritance[property] = inheritance else: - self._inheritance[property] = "ALL" + self._inheritance[property] = "FIX" if property.id is not None: self._element_by_id[str(property.id)] = property @@ -4734,7 +4735,8 @@ class Query(): next_page = self._query_request(query_dict) etag = next_page.query.etag if etag is not None and etag != self.etag: - raise PagingConsistencyError("The database state changed while retrieving the pages") + raise PagingConsistencyError( + "The database state changed while retrieving the pages") yield next_page index += page_length @@ -4894,7 +4896,7 @@ def execute_query( class DropOffBox(list): def __init__(self, *args, **kwargs): warn(DeprecationWarning( - "The DropOffBox is deprecated and will be removed in future.")) + "The DropOffBox is deprecated and will be removed in future.")) super().__init__(*args, **kwargs) path = None