#1550 Update widget definitions to latest EasyWidgets standards

unreleased
open
nobody
sf-4 (350)
General
nobody
2015-02-07
2011-02-23
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

  • Paul Sokolovsky - 2011-02-23
    • milestone: limbo --> mar-03
     
  • Paul Sokolovsky - 2011-04-12
    • assigned_to: Paul Sokolovsky --> nobody
    • size: 4 --> 4
     

Log in to post a comment.