[Zope3-Users] Re: issue with createObject() ?
Dylan Reinhardt
dylanreinhardt at gmail.com
Fri Jun 10 23:11:07 EDT 2005
On 6/10/05, Dylan Reinhardt <dylanreinhardt at gmail.com> wrote:
> I'm seeing some differences between adding objects using the adding
> traverser and using createObject(). Specifically, workflow seems not
> to get set up for the latter (all other factors the same).
Nothing like posting to a list to help you figure out what's wrong. :-)
I needed to post an ObjectCreateEvent.
For posterity, this works just great:
----
from zope.proxy import removeAllProxies
from zope.app.zapi import createObject
from zope.event import notify
from zope.app.event.objectevent import ObjectCreatedEvent
obj_name = 'foo'
my_factory = 'some.valid.factory.name'
newtask = removeAllProxies(createObject(my_factory))
notify(ObjectCreatedEvent(newtask))
task_container[obj_name] = newtask
----
Sorry for the noise.
Dylan
More information about the Zope3-users
mailing list