Permalink
Browse files

Handle arguments to display() called as instance method.

 - Fixes #41
  • Loading branch information...
ralphbean committed Jul 11, 2012
1 parent 7c61047 commit 86894492d5c1565c7d49747bde8f5c848dbc9b61
Showing with 6 additions and 1 deletion.
  1. +6 −1 tw2/core/widgets.py
@@ -382,7 +382,12 @@ def display(self, cls, value=None, displays_on=None, **kw):
if value is not None and 'value' not in kw:
kw['value'] = value
if not self:
# Support arguments to .display on either instance or class
# https://github.com/toscawidgets/tw2.core/issues/41
if self:
for key, value in kw.items():
setattr(self, key, value)
else:
self = cls.req(**kw)
if not self.parent:

0 comments on commit 8689449

Please sign in to comment.