Commit dac80eb4 authored by Nicolas Dumazet's avatar Nicolas Dumazet

if we're creating accessors for Base Category, the accessor holder was already

created. Move the test up, before accessor creation.

The accessor holder name is also BaseCategory instead of "Base Category".

After this, we should get back all related category accessors.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42910 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ee02406b
......@@ -284,24 +284,25 @@ def generatePortalTypeClass(site, portal_type_name):
import erp5
if property_sheet_set:
# Initialize ZODB Property Sheets accessor holders
_fillAccessorHolderList(
accessor_holder_list,
property_sheet_tool.createZodbPropertySheetAccessorHolder,
property_sheet_set,
erp5.accessor_holder,
property_sheet_tool)
if "Base" in property_sheet_set:
accessor_holder = None
# useless if Base Category is not yet here
if hasattr(erp5.accessor_holder, "Base Category"):
# or if we're currently generating accessors for Base Categories
if hasattr(erp5.accessor_holder, "BaseCategory"):
accessor_holder = _generateBaseAccessorHolder(
site,
erp5.accessor_holder)
if accessor_holder is not None:
accessor_holder_list.append(accessor_holder)
# Initialize ZODB Property Sheets accessor holders
_fillAccessorHolderList(
accessor_holder_list,
property_sheet_tool.createZodbPropertySheetAccessorHolder,
property_sheet_set,
erp5.accessor_holder,
property_sheet_tool)
# XXX a hook to add per-portal type accessor holders maybe?
if portal_type_name == "Preference Tool":
accessor_holder = _generatePreferenceToolAccessorHolder(
......
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