Ticket #2332 (new defect)

Opened 9 years ago

Indirect Widget forwarding is too constrained

Reported by: gracinet Owned by: gracinet
Priority: P2 Milestone: CPS 3.5.7
Component: CPSSchemas Version: 3.5.2
Severity: major Keywords:
Cc:

Description

Currently, the Indirect Widget, introduced for #851, only forwards a fixed list of attributes to its template widget.

This has been made assuming that access to the widget API on the widget is either made by the layout (closed list of calls) or from within one of those API methods (so, in that case the object is not the Indirect Widget, but its template, and everything's fine).

But there are another cases : namely, a compound widget can very well call specific methods on its sub-widgets, and this ends up in AttributeError, because these are naturally Indirect Widgets.

Either we shoul find a way to forward all methods, inconditionnaly, or we could find a way for speciic classes to specify more attributes to be forwarded if they are being used in an Indirect Widget context.

In the meanwhile, monkey-patching IndirectWidget.forwarded_attributes is a quickfix for projects that'd need it.

Note: See TracTickets for help on using tickets.