Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1171 (closed defect: wontfix)

Opened 13 years ago

Last modified 12 years ago

WidgetsList should allow inheritance

Reported by: grover Owned by: anonymous
Priority: normal Milestone:
Component: TurboGears Version: 1.0b1
Severity: normal Keywords:
Cc:

Description

class A(w.WidgetsList?):

name = w.TextField?()

Class B(A):

address = w.TextField?()

my_form = w.TableForm?(fields=B())

This form has "address" but not "name". Shouldn't WidgetsLists? inherit their fields? Or, maybe I'm trying to go about this the wrong way...

Change History

comment:1 Changed 13 years ago by alberto

  • Status changed from new to closed
  • Resolution set to wontfix

I believe you're addressing this the wrong way. WidgetsLists? are just a (arguably) nicer syntax for defining and ordered list of widgets. Actually, the metaclass takes care of popping out all class attributes (you can't do mylist.name for example).

If you need to combine several widget lists the best way is to use normal list operations with them, for example: fields = CommonFields() + ExtraFields()

The problem with inheritance would be that the order of the fields would be unpedictable.

I'm closing this as 'wontfix' for the meantime.

Alberto

Note: See TracTickets for help on using tickets.