charlie at begeistert
Jun 30, 2008, 8:35 AM
Post #26 of 26
Am 13.05.2008 um 23:39 schrieb yuppie:
>> If a new style factory is specified in the FTI a view of that name
>> is looked up on the adding view of the container. This is from
>> addingview = queryMultiAdapter((addContext, self.request), name='+')
>> if addingview is not None:
>> addview = queryMultiAdapter((addingview, self.request),
>> if addview is not None:
>> return '%s/+/%s' % (baseUrl, fti.factory,)
> That means view name and factory name have to be the same. The
> portal type is not passed to the view, so it has to be hardcoded
> inside the view. Not very flexible, but if factory and view are only
> used for one hardcoded portal type it works.
Any more thoughts on this? I agree with you that the hardcoded
approach above isn't nice but can't think of a nice way to square the
circle where the add forms are registered for the container and not
the new object.
Is it possible to do something with actions? Either by defining an
additional category such as "add" on the objects themselves? That
would be easy enough from the object's perspective but would conflict
with the current lookup on the folder category. This shouldn't be too
bad as this could be replaced by looking at the allowed_content_types.
But I guess this might have the same complexity and performance
problems as relying on IAdding.
Zope-CMF maillist - Zope-CMF [at] lists
See http://collector.zope.org/CMF for bug reports and feature requests