Ejemplo n.º 1
0
 def factory_method(container, identifier=None, REQUEST=None, *args, **kw):
     """Create a instance of that service, callable through the web.
     """
     identifier = get_service_id(factory, identifier)
     identifier = normalize_identifier(identifier)
     if identifier is None:
         raise ValueError("No id for the new service")
     service = factory(identifier, *args, **kw)
     service = registerService(
         container, identifier, service, service_interface)
     notify(ObjectCreatedEvent(service))
     if REQUEST is not None:
         REQUEST.response.redirect(
             service.absolute_url() + '/manage_workspace')
         return ''
     else:
         return service
Ejemplo n.º 2
0
 def __init__(self, id=None, title=None, *args, **kw):
     # Compatibility with SilvaService factory
     super(CatalogService, self).__init__(get_service_id(self, id), title or self.meta_type, *args, **kw)