Ticket #8088: cat_filter.diff

File cat_filter.diff, 717 bytes (added by David Avsajanishvili, 16 years ago)

"cat" filter (concatenate argument with value)

  • django/template/defaultfilters.py

     
    6262capfirst.is_safe=True
    6363capfirst = stringfilter(capfirst)
    6464
     65def cat(value, arg):
     66    """
     67    Concatenates value with argument
     68    """
     69    return u"%s%s" % (value, force_unicode(arg))
     70cat.is_safe=True
     71cat = stringfilter(cat)
     72
     73
    6574_js_escapes = (
    6675    ('\\', '\\\\'),
    6776    ('"', '\\"'),
     
    797806register.filter(add)
    798807register.filter(addslashes)
    799808register.filter(capfirst)
     809register.filter(cat)
    800810register.filter(center)
    801811register.filter(cut)
    802812register.filter(date)
Back to Top