id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 4418,Add media descriptions to newforms widgets,Russell Keith-Magee,Russell Keith-Magee," A newforms widget currently defines the way to render a user interface input element. However, in order to make interesting input elements, you also need other media - i.e., Javascript and CSS. These requirements can be defined on a per-widget basis (a Date field requires a Calendar widget; the calendar widget requires media/calendar.js and media/calendar.css). At present, there is no easy way to: 1. identify what media is required to display a form 1. identify and eliminate any duplicate media requirements, e.g., a base css file required by two different widgets on a form. newforms-admin has some hand rolled functionality to determine Javascript requirements for a page. This ticket describes a more general solution that could be applied to any widget, and therefore to any form. It involves adding a meta-class to Widget that processes a 'Media' inner class; this inner class is turned into a 'Media' object. Media objects can be printed (yielding and