Commit 3510a2b1 authored by Vincent Pelletier's avatar Vincent Pelletier

Document setattr-getattr pattern.

parent 660ae35a
...@@ -943,6 +943,12 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -943,6 +943,12 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
method = RelatedBaseCategory(base_category_id) method = RelatedBaseCategory(base_category_id)
setattr(self.__class__, name, method) setattr(self.__class__, name, method)
# This getattr has 2 purposes:
# - wrap in acquisition context
# This alone should be explicitly done rather than through getattr.
# - wrap (if needed) class attribute on the instance
# (for the sake of not relying on current implementation details
# "too much")
result = getattr(self, name) result = getattr(self, name)
return result return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment