Did I find the right examples for you? yes no

All Samples(177)  |  Call(114)  |  Derive(0)  |  Import(63)
Explicitly mark a string as safe for (HTML) output purposes. The returned
object can be used everywhere a string or unicode object is appropriate.

Can be called multiple times on a single string.

        def mark_safe(s):
    """
    Explicitly mark a string as safe for (HTML) output purposes. The returned
    object can be used everywhere a string or unicode object is appropriate.

    Can be called multiple times on a single string.
    """
    if isinstance(s, SafeData):
        return s
    if isinstance(s, bytes) or (isinstance(s, Promise) and s._delegate_bytes):
        return SafeBytes(s)
    if isinstance(s, (six.text_type, Promise)):
        return SafeText(s)
    return SafeString(str(s))
        


src/d/j/django-dynamic-forms-0.2/dynamic_forms/models.py   django-dynamic-forms(Download)
from django.template.defaultfilters import slugify
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import escape, mark_safe
from django.utils.translation import ugettext as _
 
class FormModel(models.Model):
    name = models.CharField(_('Name'), max_length=50, unique=True)
    submit_url = models.CharField(_('Submit URL'), max_length=100, unique=True,
        help_text=mark_safe(_('The full URL path to the form. It should start '
            'and end with a forward slash (<code>/</code>).')))
    success_url = models.CharField(_('Success URL'), max_length=100,
        help_text=mark_safe(_('The full URL path where the user will be '
                })
            output.append('</dl>')
            return mark_safe(''.join(output))
        except ValueError:
            return self.value

src/d/j/dj-dynamic-forms-0.4.dev20140206215248/dynamic_forms/models.py   dj-dynamic-forms(Download)
from django.template.defaultfilters import slugify
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import escape, mark_safe
from django.utils.translation import ugettext as _
 
class FormModel(models.Model):
    name = models.CharField(_('Name'), max_length=50, unique=True)
    submit_url = models.CharField(_('Submit URL'), max_length=100, unique=True,
        help_text=mark_safe(_('The full URL path to the form. It should start '
            'and end with a forward slash (<code>/</code>).')))
    success_url = models.CharField(_('Success URL'), max_length=100,
        help_text=mark_safe(_('The full URL path where the user will be '
                })
            output.append('</dl>')
            return mark_safe(''.join(output))
        except ValueError:
            return self.value

src/d/j/dj-dynamic-forms-HEAD/dynamic_forms/models.py   dj-dynamic-forms(Download)
from django.template.defaultfilters import slugify
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import escape, mark_safe
from django.utils.translation import ugettext as _
 
class FormModel(models.Model):
    name = models.CharField(_('Name'), max_length=50, unique=True)
    submit_url = models.CharField(_('Submit URL'), max_length=100, unique=True,
        help_text=mark_safe(_('The full URL path to the form. It should start '
            'and end with a forward slash (<code>/</code>).')))
    success_url = models.CharField(_('Success URL'), max_length=100,
        help_text=mark_safe(_('The full URL path where the user will be '
                })
            output.append('</dl>')
            return mark_safe(''.join(output))
        except ValueError:
            return self.value

src/a/f/affiliates-HEAD/vendor-local/packages/django-mptt/mptt/forms.py   affiliates(Download)
except ImportError:
    from django.utils.encoding import smart_unicode as smart_text
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
 
    def _get_level_indicator(self, obj):
        level = getattr(obj, obj._mptt_meta.level_attr)
        return mark_safe(conditional_escape(self.level_indicator) * level)
 
    def label_from_instance(self, obj):
        """
        level_indicator = self._get_level_indicator(obj)
        return mark_safe(level_indicator + ' ' + conditional_escape(smart_text(obj)))
 
 

src/d/j/django-media-tree-0.8.1/media_tree/contrib/legacy_mptt_support/forms.py   django-media-tree(Download)
from django.forms.util import ErrorList
from django.utils.encoding import smart_unicode
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
 
        """
        level = getattr(obj, obj._mptt_meta.level_attr)
        level_indicator = mark_safe(conditional_escape(self.level_indicator) * level)
        return mark_safe(u'%s %s' % (level_indicator, conditional_escape(smart_unicode(obj))))
 

src/m/i/Misago-HEAD/misago/forms/fields.py   Misago(Download)
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
from floppyforms import fields, widgets
from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
from misago.forms.widgets import ReCaptchaWidget
    def _get_level_indicator(self, obj):
        level = getattr(obj, obj._mptt_meta.level_attr)
        return mark_safe(conditional_escape(self.level_indicator) * (level - 1))
 
 
    def _get_level_indicator(self, obj):
        level = getattr(obj, obj._mptt_meta.level_attr)
        return mark_safe(conditional_escape(self.level_indicator) * (level - 1))
 
 

src/d/j/django-easydata-0.1/easydata/templatetags/easydata_microdata.py   django-easydata(Download)
 
from django import template
from django.utils.html import escape, mark_safe
 
from easydata.models import Field
        resultado += '</%s>\n' % tag1
 
    return mark_safe(resultado)
 
 
                                                               datos['uri'])
 
            resultado = mark_safe(resultado)
            resultado += self.nodelist.render(context)
            resultado += '</' + self.etiqueta + '>'
                                         datos['uri'])
 
                resultado = mark_safe(resultado)
                resultado += self.nodelist.render(context)
                resultado += '</' + self.etiqueta + '>'

src/m/y/my-vagrant-puppet-python-HEAD/utils/django-mptt-0.5.2/mptt/forms.py   my-vagrant-puppet-python(Download)
from django.forms.util import ErrorList
from django.utils.encoding import smart_unicode
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
 
    def _get_level_indicator(self, obj):
        level = getattr(obj, obj._mptt_meta.level_attr)
        return mark_safe(conditional_escape(self.level_indicator) * level)
 
    def label_from_instance(self, obj):
        """
        level_indicator = self._get_level_indicator(obj)
        return mark_safe(u'%s %s' % (level_indicator, conditional_escape(smart_unicode(obj))))
 
 

src/l/o/logpress-HEAD/blog/mptt/forms.py   logpress(Download)
from django.forms.util import ErrorList
from django.utils.encoding import smart_unicode
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
 
        """
        level = getattr(obj, obj._mptt_meta.level_attr)
        level_indicator = mark_safe(conditional_escape(self.level_indicator) * level)
        return mark_safe(u'%s %s' % (level_indicator, conditional_escape(smart_unicode(obj))))
 

src/d/j/django-mptt-0.6.0/mptt/forms.py   django-mptt(Download)
except ImportError:
    from django.utils.encoding import smart_unicode as smart_text
from django.utils.html import conditional_escape, mark_safe
from django.utils.translation import ugettext_lazy as _
 
    def _get_level_indicator(self, obj):
        level = getattr(obj, obj._mptt_meta.level_attr)
        return mark_safe(conditional_escape(self.level_indicator) * level)
 
    def label_from_instance(self, obj):
        """
        level_indicator = self._get_level_indicator(obj)
        return mark_safe(level_indicator + ' ' + conditional_escape(smart_text(obj)))
 
 

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