Am 13.02.2008 um 23:14 schrieb Charlie Clark:

BTW. this is probably academic but I noticed the top of the is
from import IVocabularyFactory
Is there a reason for not importing the interface directly?

I've finally got some initial code for this.

def contentTypeVocabulary(context):
    type_infos = context.allowedContentTypes()
    types = [SimpleTerm(,, t.Title()) for t in type_infos]
    return SimpleVocabulary(types)

ContentTypeVocabularyFactory = Factory(ContentTypes)

Unless I'm very much mistaken the action for adding an item to a folder can be achieved by something like the following:

def _handle_success(self, action, data):
    id = data['id']
    type_name = data['content_types']
    self.context.invokeFactory(type_name, id)

Although I'm not quite sure on handling the redirection to the newly created object.

Charlie Clark
Helmholtzstr. 20
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226

Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to