I'm having problems with my Add Forms views (based in
formlib.form.AddForm) in my transition from Zope 3.2 to Zope 3.3.
In Zope 3.2 I registered my views like this:
And my container implemented the marker interface
The default view for my container has an 'Add' button with an action that just
Everything worked fine with this model.
Now, in Zope 3.3 I have two problems:
1. If I don't add the directive <containerViews> to my container I get a
NotFound exception when
going to '/mycontainer/+/addPerson.html'. To fix this problem I have added
2. When my add form is displayed in the Rotterdam skin I get an extra tab for
every other contenttype
I have a page registered like the example above. For example, I also have a
Product content type and it
has an AddForm like the Person AddForm. When I'm looking at
'/mycontainer/+/addPerson.html' I got 4 tabs:
- Add (the one for adding the person)
- Add Product
And obviously I shouldn't get the second tab. Looks like it is showing
everything that is registered for the
IAdding interface, and that sound logical but my question is: Why it didn't
work that way in Zope 3.2? and,
How do I get my expected behavior?
Extra thoughts: Probably the cause of my problems is that I don't fully
understand the adding process
in Zope 3 so I'll try to explain what I think it is happening just in case
anyone can correct me if I'm wrong:
When traversing '/mycontainer/+/addPerson.html' Zope gets to the '+' path and
it gets a view for the
IMyContainer interface. This view is handled by the
zope.app.container.browser.adding.Adding class that
implements the zope.app.container.interfaces.IAdding interface. Then, traversal
continues to 'addPerson.html'
and Zope gets my view that is registered for IAdding. So I got a view for a
(previous) view object that is
applied to my container. That's why in my AddForm self.context is the Adding
object and self.context.context
is my container object.
Zope3-users mailing list