Commit 34ff8432 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Do not store Persistent object in Component registry cache.

parent ed8c36b0
...@@ -123,7 +123,7 @@ class ComponentDynamicPackage(ModuleType): ...@@ -123,7 +123,7 @@ class ComponentDynamicPackage(ModuleType):
# beforehand # beforehand
if version in version_priority_set: if version in version_priority_set:
reference = component.getReference(validated_only=True) reference = component.getReference(validated_only=True)
self.__registry_dict.setdefault(reference, {})[version] = component self.__registry_dict.setdefault(reference, {})[version] = component.getId()
return self.__registry_dict return self.__registry_dict
...@@ -241,7 +241,7 @@ class ComponentDynamicPackage(ModuleType): ...@@ -241,7 +241,7 @@ class ComponentDynamicPackage(ModuleType):
(fullname, self._namespace, error)) (fullname, self._namespace, error))
try: try:
component = self._registry_dict[name][version] component_id = self._registry_dict[name][version]
except KeyError: except KeyError:
raise ImportError("%s: version %s of Component %s could not be found" % \ raise ImportError("%s: version %s of Component %s could not be found" % \
(fullname, version, name)) (fullname, version, name))
...@@ -256,8 +256,8 @@ class ComponentDynamicPackage(ModuleType): ...@@ -256,8 +256,8 @@ class ComponentDynamicPackage(ModuleType):
# Version priority name list is ordered in descending order # Version priority name list is ordered in descending order
for version in site.getVersionPriorityNameList(): for version in site.getVersionPriorityNameList():
component = component_version_dict.get(version) component_id = component_version_dict.get(version)
if component is not None: if component_id is not None:
break break
else: else:
raise ImportError("%s: no version of Component %s in Site priority" % \ raise ImportError("%s: no version of Component %s in Site priority" % \
...@@ -275,6 +275,8 @@ class ComponentDynamicPackage(ModuleType): ...@@ -275,6 +275,8 @@ class ComponentDynamicPackage(ModuleType):
module_fullname_alias = self._namespace + '.' + name module_fullname_alias = self._namespace + '.' + name
component = getattr(site.portal_components, component_id)
module_fullname = '%s.%s_version.%s' % (self._namespace, version, name) module_fullname = '%s.%s_version.%s' % (self._namespace, version, name)
module = ModuleType(module_fullname, component.getDescription()) module = ModuleType(module_fullname, component.getDescription())
......
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