      return value.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'")
  addslashes = stringfilter(addslashes)
  
  def capfirst(value):
      "Capitalizes the first character of the value"
      return value and value[0].upper() + value[1:]
  capfirst = stringfilter(capfirst)
  
  def fix_ampersands(value):
      "Replaces ampersands with ``&amp;`` entities"
 
</s> remove     "Replaces ampersands with ``&amp;`` entities"
 </s> add     """Replaces ampersands with ``&amp;`` entities.""" </s> remove     "Adds slashes - useful for passing strings to JavaScript, for example."
 </s> add     """Adds slashes - useful for passing strings to JavaScript, for example.""" </s> remove     # Find the maximum width of the line count, for use with zero padding string format command
 </s> add     # Find the maximum width of the line count, for use with zero padding
    # string format command. </s> remove     "Adds the arg to the value"
 </s> add     """Adds the arg to the value.""" </s> remove     "Centers the value in a field of a given width"
 </s> add     """Centers the value in a field of a given width."""
    """Capitalizes the first character of the value."""
      return value.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'")
  addslashes = stringfilter(addslashes)
  
  def capfirst(value):
    """Capitalizes the first character of the value."""
      return value and value[0].upper() + value[1:]
  capfirst = stringfilter(capfirst)
  
  def fix_ampersands(value):
      "Replaces ampersands with ``&amp;`` entities"
keep keep keep keep replace keep keep keep keep keep
 Style and import fixes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6641 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/template/defaultfilters.py