Small refactoring: actually wrap in the provider in provider.__parent__, which

*usually* ends up being the view, unless the provider decides otherwise.
parent cfdca86c
...@@ -41,10 +41,10 @@ class Z2ProviderExpression(StringExpr): ...@@ -41,10 +41,10 @@ class Z2ProviderExpression(StringExpr):
if provider is None: if provider is None:
raise cp_interfaces.ContentProviderLookupError(name) raise cp_interfaces.ContentProviderLookupError(name)
# A content provider's context (__parent__) is the view, not # Wrap the content provider's in its __parent__, whatever that
# the context object. # may be (typically the view).
if getattr(provider, '__of__', None) is not None: if getattr(provider, '__of__', None) is not None:
provider = provider.__of__(view) provider = provider.__of__(provider.__parent__)
# Insert the data gotten from the context # Insert the data gotten from the context
addTALNamespaceData(provider, econtext) addTALNamespaceData(provider, econtext)
......
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