Did I find the right examples for you? yes no

All Samples(790)  |  Call(554)  |  Derive(0)  |  Import(236)

        def format_html(format_string, *args, **kwargs):
    """
    Similar to str.format, but passes all arguments through conditional_escape,
    and calls 'mark_safe' on the result. This function should be used instead
    of str.format or % interpolation to build up small HTML fragments.
    """
    args_safe = map(conditional_escape, args)
    kwargs_safe = dict([(k, conditional_escape(v)) for (k, v) in
                        six.iteritems(kwargs)])
    return mark_safe(format_string.format(*args_safe, **kwargs_safe))
        


src/r/e/reviewboard-HEAD/reviewboard/reviews/builtin_fields.py   reviewboard(Download)
from django.template.loader import Context, get_template
from django.utils import six
from django.utils.html import escape, format_html, format_html_join
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
 
            s.append(format_html(
                '<tr>'
                ' <th><a href="{url}">{filename}</a>:</th>'
                ' <td>{caption}</td>'
    def render_change_entry_item_html(self, info, item):
        item = ReviewRequest.objects.get(pk=item[2])
 
        rendered_item = format_html(
            '<a href="{url}">{id} - {summary}</a>',
    def render_item(self, item):
        rendered_item = format_html(
            '<a href="{url}" title="{summary}">{id}</a>',
            url=item.get_absolute_url(),
            summary=item.summary,
        # Display the label, URL, and line counts for the diff.
        s.append(format_html(
            '<p class="diff-changes">'
            ' <a href="{url}">{label}</a>'
            ' <span class="line-counts">({line_counts})</span>'

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py   antisocial(Download)
from django.db import models
from django.utils import formats
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
                yield {
                    "text": text,
                    "class_attrib": format_html(' class="column-{0}"', field_name),
                    "sortable": False,
                }
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py   rolf(Download)
from django.db import models
from django.utils import formats
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
                yield {
                    "text": text,
                    "class_attrib": format_html(' class="column-{0}"', field_name),
                    "sortable": False,
                }
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }

src/p/o/pourover-HEAD/buster/lib/django/contrib/admin/templatetags/admin_list.py   pourover(Download)
from django.db import models
from django.utils import formats
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
                yield {
                    "text": text,
                    "class_attrib": format_html(' class="column-{0}"', field_name),
                    "sortable": False,
                }
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }

src/u/p/UP-Manager-0.0.0/django/contrib/admin/templatetags/admin_list.py   UP-Manager(Download)
from django.db import models
from django.utils import formats
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
                yield {
                    "text": text,
                    "class_attrib": format_html(' class="column-{0}"', field_name),
                    "sortable": False,
                }
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }

src/d/j/Django-1.6.4/django/contrib/admin/templatetags/admin_list.py   Django(Download)
from django.db import models
from django.utils import formats
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
                yield {
                    "text": text,
                    "class_attrib": format_html(' class="column-{0}"', field_name),
                    "sortable": False,
                }
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }

src/a/p/appscale-HEAD/AppServer/lib/django-1.5/django/contrib/admin/templatetags/admin_list.py   appscale(Download)
from django.db import models
from django.utils import formats
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils import six
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }
 
def _boolean_icon(field_val):
    icon_url = static('admin/img/icon-%s.gif' %
                      {True: 'yes', False: 'no', None: 'unknown'}[field_val])
    return format_html('<img src="{0}" alt="{1}" />', icon_url, field_val)

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/django/contrib/admin/templatetags/admin_list.py   socorro(Download)
from django.db import models
from django.utils import formats
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils import six
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }
 
def _boolean_icon(field_val):
    icon_url = static('admin/img/icon-%s.gif' %
                      {True: 'yes', False: 'no', None: 'unknown'}[field_val])
    return format_html('<img src="{0}" alt="{1}" />', icon_url, field_val)

src/g/o/google-app-engine-HEAD/lib/django-1.5/django/contrib/admin/templatetags/admin_list.py   google-app-engine(Download)
from django.db import models
from django.utils import formats
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils import six
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }
 
def _boolean_icon(field_val):
    icon_url = static('admin/img/icon-%s.gif' %
                      {True: 'yes', False: 'no', None: 'unknown'}[field_val])
    return format_html('<img src="{0}" alt="{1}" />', icon_url, field_val)

src/c/a/captain-HEAD/vendor/lib/python/django/contrib/admin/templatetags/admin_list.py   captain(Download)
from django.db import models
from django.utils import formats
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils import six
        return '... '
    elif i == cl.page_num:
        return format_html('<span class="this-page">{0}</span> ', i+1)
    else:
        return format_html('<a href="{0}"{1}>{2}</a> ',
            "url_remove": cl.get_query_string({ORDER_VAR: '.'.join(o_list_remove)}),
            "url_toggle": cl.get_query_string({ORDER_VAR: '.'.join(o_list_toggle)}),
            "class_attrib": format_html(' class="{0}"', ' '.join(th_classes))
                            if th_classes else '',
        }
 
def _boolean_icon(field_val):
    icon_url = static('admin/img/icon-%s.gif' %
                      {True: 'yes', False: 'no', None: 'unknown'}[field_val])
    return format_html('<img src="{0}" alt="{1}" />', icon_url, field_val)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next