Commit bd5bb49e authored by Arnaud Fontaine's avatar Arnaud Fontaine

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

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