Commit 1c7f2108 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Partly re-add hardcoding for bootstraping.

you can't call getattr(type_tool, portal_type_name) if Base Type
and Solver Type portal types are not loaded yet:
  type_tool[portal_type_name].__of__(type_tool)
requires loading the class to access __of__ method.

For now, we'll have to hardcode a bit more to get test results.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39415 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b7e3f136
......@@ -111,6 +111,11 @@ def portalTypeFactory(portal_type_name):
site = getSite()
type_tool = site.portal_types
if portal_type_name == "Base Type":
type_class = "ERP5TypeInformation"
elif portal_type_name == "Solver Type":
type_class = "SolverTypeInformation"
else:
try:
portal_type = getattr(type_tool, portal_type_name)
except:
......@@ -135,7 +140,7 @@ def portalTypeFactory(portal_type_name):
% portal_type_name)
except AttributeError:
# Try to figure out a coresponding document class from the document side.
# This is required for the bootstrap (e.g. Base Type).
# This is required for the bootstrap (e.g. Base Category).
for name, path in document_class_registry.iteritems():
# XXX heuristic: bootstrap issues should happen only inside ERP5Type.
if not path.startswith('Products.ERP5Type.'):
......
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