-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
(Posted this in tw2.forms by accident)
Inheritence as described in http://tw2core.readthedocs.org/en/latest/design/#declarative-instantiation does not work. Example code:
import tw2.core as twc
import tw2.devtools
import tw2.forms as twf
class Index(twf.FormPage):
class MyFields(twc.CompoundWidget):
b = twf.TextArea()
x = twf.Label(text='this is a test')
c = twf.TextField()
class TableFields(MyFields, twf.TableLayout):
pass
class ListFields(MyFields, twf.ListLayout):
b = twf.TextField()
tw2.devtools.dev_server()Gives the following error:
Traceback (most recent call last):
File "myapp.py", line 5, in <module>
class Index(twf.FormPage):
File "myapp.py", line 15, in Index
class ListFields(MyFields, twf.ListLayout):
File "/home/pieter/.virtualenvs/tw2dev/local/lib/python2.7/site-packages/tw2/core/widgets.py", line 81, in __new__
w.post_define.__func__(widget)
File "/home/pieter/.virtualenvs/tw2dev/local/lib/python2.7/site-packages/tw2/core/widgets.py", line 604, in post_define
raise core.WidgetError("Duplicate id '%s'" % c.id)
tw2.core.core.WidgetError: Duplicate id 'b'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels