Пример #1
0
    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()
Пример #2
0
    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()
Пример #3
0
 class Media:
     if RENDER_SELECT2_STATICS:
         js = get_select2_heavy_js_libs()
         css = {'screen': get_select2_css_libs()}
Пример #4
0
 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))
Пример #6
0
def import_css(light=0):
    return '\n'.join(link_tag(css_file) for css_file in get_select2_css_libs(light=light))