[Product-Developers] Re: setDefaulPage for subcatalog

Raphael Ritz r.ritz at biologie.hu-berlin.de
Wed Feb 25 15:24:28 UTC 2009


Jaroslav Šatkevič wrote:

[..]

> subjectFactory = Factory(Subject, title=_(u"Create new subject"))
> 
> 
> def subject_added_event(subject, event):
>    """Subject processing after creation:
>    add wiki
>    """
>    wiki_id = 'wiki'
>    default_text = 'Mano ((batai)) buvo du, vienas dingo, nerandu.'
>    obj = event.object
>      if wiki_id not in obj.objectIds():
>        obj.invokeFactory('WikiCatalog', id=wiki_id,)
>        obj.setDefaultPage(wiki_id)
> 
> 
> 
> Why this don't work?

Since you don't base your subject type on Archetypes
you have to make sure for yourself that (i) you register
it with the types tool using a "Factory-based Type
Information with dynamic views" and (ii) that you
equip your subject class with the BrowserDefaultMixin
class.

Raphael

> 
> -- 
> Jaro





More information about the Product-Developers mailing list