#1550 Update widget definitions to latest EasyWidgets standards

someday
open
nobody
None
nobody
General
4
2011-09-12
2011-02-23
Paul Sokolovsky
No

In [#1549] one of the issue was due to the fact that widgets use old definitions syntax. It makes sense to convert them all to avoid such issues.

(2011-02-23 17:55:56) rcopeland: ok, so the move to use the defaults() dict was intentional on my part
(2011-02-23 17:56:26) rcopeland: we previously copied over attributes listed in the 'params' attribute, but I thought that was pretty hacky
(2011-02-23 17:56:46) rcopeland: and explicit is better than implicit, so I went to defaults -- not 100% of the allura code has been updated, however

Here's example of the conversion:

 class ThreadHeader(HierWidget):
     template='jinja:widgets/thread_header.html'
-    params=['value', 'page', 'limit', 'count', 'show_moderate']
-    value=None
-    page=None
-    limit=None
-    count=None
-    show_moderate=False
+    defaults=dict(
+        HierWidget.defaults,
+        value=None,
+        page=None,
+        limit=None,
+        count=None,
+        show_moderate=False)

Related

Tickets: #1549

Discussion


Anonymous


Cancel   Add attachments