def _get_media(self): """ Construct Media as a dynamic property This is essential because we need to check RENDER_SELECT2_STATICS before returning our assets. for more information: https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property """ if RENDER_SELECT2_STATICS: return forms.Media(js=get_select2_heavy_js_libs(), css={'screen': get_select2_css_libs()}) return forms.Media()
def _get_media(self): """ Construct Media as a dynamic property This is essential because we need to check RENDER_SELECT2_STATICS before returning our assets. for more information: https://docs.djangoproject.com/en/1.8/topics/forms/media/#media-as-a-dynamic-property """ if RENDER_SELECT2_STATICS: return forms.Media( js=get_select2_heavy_js_libs(), css={'screen': get_select2_css_libs()} ) return forms.Media()
class Media: if RENDER_SELECT2_STATICS: js = get_select2_heavy_js_libs() css = {'screen': get_select2_css_libs()}
class Media: if RENDER_SELECT2_STATICS: js = get_select2_js_libs() css = { 'screen': get_select2_css_libs(light=True), }
def import_css(light=0): return '\n'.join( link_tag(css_file) for css_file in get_select2_css_libs(light=light))
def import_css(light=0): return '\n'.join(link_tag(css_file) for css_file in get_select2_css_libs(light=light))