def install_cp_and_products(self): app = self.getApp() # Ensure that Control Panel exists. if not hasattr(app, 'Control_Panel'): cpl = ApplicationManager() cpl._init() app._setObject('Control_Panel', cpl) self.commit('Added Control_Panel') else: # Inline migration of old databases cp = app.Control_Panel ids = [i['id'] for i in cp._objects] if 'Versions' in ids: new = [] for entry in cp._objects: if entry['id'] != 'Versions': new.append(entry) cp._objects = tuple(new) self.commit('Removed Control_Panel.Versions') # b/c: Ensure that a ProductFolder exists. if not hasattr(aq_base(app.Control_Panel), 'Products'): app.Control_Panel.Products = App.Product.ProductFolder() self.commit('Added Control_Panel.Products')
def __init__(self): # Initialize users uf = UserFolder() self.__allow_groups__ = uf self._setObject('acl_users', uf) # Initialize control panel cpl = ApplicationManager() cpl._init() self._setObject('Control_Panel', cpl) transaction.get().note("Created Zope Application")
def install_app_manager(self): global APP_MANAGER APP_MANAGER = ApplicationManager() # Remove persistent Control Panel. app = self.getApp() app._p_activate() if 'Control_Panel' in list(app.__dict__.keys()): del app.__dict__['Control_Panel'] app._objects = tuple(i for i in app._objects if i['id'] != 'Control_Panel') self.commit('Removed persistent Control_Panel')
def install_cp_and_products(self): global APP_MANAGER APP_MANAGER = ApplicationManager() APP_MANAGER._init() app = self.getApp() app._p_activate() # Remove Control Panel. if 'Control_Panel' in app.__dict__.keys(): del app.__dict__['Control_Panel'] app._objects = tuple(i for i in app._objects if i['id'] != 'Control_Panel') self.commit('Removed persistent Control_Panel')
def install_cp_and_products(self): app = self.getApp() # Ensure that Control Panel exists. if not hasattr(app, 'Control_Panel'): cpl = ApplicationManager() cpl._init() app._setObject('Control_Panel', cpl) self.commit('Added Control_Panel') # b/c: Ensure that a ProductFolder exists. if not hasattr(aq_base(app.Control_Panel), 'Products'): app.Control_Panel.Products = App.Product.ProductFolder() self.commit('Added Control_Panel.Products')