Formalize Admin widgets a bit more, and make them class-based.
Review Request #2655 — Created Oct. 11, 2011 and submitted — Latest diff uploaded
Formalize Admin widgets a bit more, and make them class-based. Admin widgets were just functions that had to return certain data in a dictionary, handle their own caching, and were a bit hard-coded in their use. Now we have a Widget class, which has some standard attributes and functions. The widgets subclass this and fill in the details they need. These are then rendered by the dashboard template and template tag, which get to be a bit more dumb now. Widgets are registered as either primary or secondary widgets. Extensions will be able to register their own, and they'll show up in the dashboard. Widget actions are a little more fleshed out as well. Instead of being tuples, they're dictionaries, making it a bit easier to maintain and look up. They can now have a 'rel' attribute, which works in some cases better than an 'id' (particularly the Activity graph). The next steps from here are to further reduce hard-coded IDs, and make it easier to re-query a widget's data, for the purpose of AJAX-based reloading.