formlib action rendering should be skin switchable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Won't Fix
|
Wishlist
|
Unassigned | ||
zope.formlib |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
Right now switching widgets by skin is easy enough by providing your own widget subclass and registering it for your own skin:
<view
type=
for=
provides=
factory=
permissio
/>
However switching action rendering by the skin is not provided for, as the .render() method of an action is actually a named template ("render"), and named templates are simple named adaptations to INamedTemplate. Customizing it involves either overriding the registration for the named "render" adapter for Action to NamedTemplate, or make your forms use an Action subclass, for which a new adapter can be provided, and these customizations still don't enable the rendering to change with the skin.
Suggestions:
- Make Action.render() a method that looks up a named "view" on the Action.
- Create a NamedViewTemplate, which expects it's 'instance' to be a view (i.e. have a 'request' attribute, and do "component.
The latter would also enable us to customize the form layout by skin, if we make the form template also be a NamedViewTemplate.
Changed in zope3: | |
importance: | Undecided → Wishlist |
status: | Unconfirmed → Confirmed |
Changed in zope.formlib: | |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
Changed in zope3: | |
status: | Confirmed → Won't Fix |
The zope.formlib project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope. formlib.